OLD | NEW |
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 Loading... |
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 |
OLD | NEW |