Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Side by Side Diff: webrtc/modules/audio_device/audio_device_buffer.cc

Issue 1168753002: Match existing type usage better. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 &_playBuffer[0], 556 &_playBuffer[0],
557 nSamplesOut, 557 nSamplesOut,
558 &elapsed_time_ms, 558 &elapsed_time_ms,
559 &ntp_time_ms); 559 &ntp_time_ms);
560 if (res != 0) 560 if (res != 0)
561 { 561 {
562 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, "NeedMorePlayData( ) failed"); 562 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, "NeedMorePlayData( ) failed");
563 } 563 }
564 } 564 }
565 565
566 return nSamplesOut; 566 return static_cast<int32_t>(nSamplesOut);
567 } 567 }
568 568
569 // ---------------------------------------------------------------------------- 569 // ----------------------------------------------------------------------------
570 // GetPlayoutData 570 // GetPlayoutData
571 // ---------------------------------------------------------------------------- 571 // ----------------------------------------------------------------------------
572 572
573 int32_t AudioDeviceBuffer::GetPlayoutData(void* audioBuffer) 573 int32_t AudioDeviceBuffer::GetPlayoutData(void* audioBuffer)
574 { 574 {
575 CriticalSectionScoped lock(&_critSect); 575 CriticalSectionScoped lock(&_critSect);
576 576
577 if (_playSize > kMaxBufferSizeBytes) 577 if (_playSize > kMaxBufferSizeBytes)
578 { 578 {
579 WEBRTC_TRACE(kTraceError, kTraceUtility, _id, "_playSize %i exceeds " 579 WEBRTC_TRACE(kTraceError, kTraceUtility, _id, "_playSize %i exceeds "
580 "kMaxBufferSizeBytes in AudioDeviceBuffer::GetPlayoutData", _playSize); 580 "kMaxBufferSizeBytes in AudioDeviceBuffer::GetPlayoutData", _playSize);
581 assert(false); 581 assert(false);
582 return -1; 582 return -1;
583 } 583 }
584 584
585 memcpy(audioBuffer, &_playBuffer[0], _playSize); 585 memcpy(audioBuffer, &_playBuffer[0], _playSize);
586 586
587 if (_playFile.Open()) 587 if (_playFile.Open())
588 { 588 {
589 // write to binary file in mono or stereo (interleaved) 589 // write to binary file in mono or stereo (interleaved)
590 _playFile.Write(&_playBuffer[0], _playSize); 590 _playFile.Write(&_playBuffer[0], _playSize);
591 } 591 }
592 592
593 return _playSamples; 593 return static_cast<int32_t>(_playSamples);
594 } 594 }
595 595
596 } // namespace webrtc 596 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/test/RTPencode.cc ('k') | webrtc/modules/audio_device/dummy/file_audio_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698