Chromium Code Reviews| Index: media/audio/win/audio_unified_win.cc |
| diff --git a/media/audio/win/audio_unified_win.cc b/media/audio/win/audio_unified_win.cc |
| index 677f9e0260aea59c10879be3e4daef4e10a206e7..de84aaa6e5b6d6c57fe7aa8bb588ac09969a3f4b 100644 |
| --- a/media/audio/win/audio_unified_win.cc |
| +++ b/media/audio/win/audio_unified_win.cc |
| @@ -246,12 +246,15 @@ void WASAPIUnifiedStream::Start(AudioSourceCallback* callback) { |
| return; |
| } |
| - // Reset the counter for number of rendered frames taking into account the |
| - // fact that we always initialize the render side with silence. |
| - UINT32 num_queued_frames = 0; |
| - audio_output_client_->GetCurrentPadding(&num_queued_frames); |
| - DCHECK_EQ(num_queued_frames, endpoint_render_buffer_size_frames_); |
| - num_written_frames_ = num_queued_frames; |
| + // Ensure that the endpoint buffer is prepared with silence. |
| + if (share_mode_ == AUDCLNT_SHAREMODE_SHARED) { |
| + if (!CoreAudioUtil::FillRenderEndpointBufferWithSilence( |
| + audio_output_client_, audio_render_client_)) { |
|
tommi (sloooow) - chröme
2013/01/31 16:18:24
same here
henrika (OOO until Aug 14)
2013/02/01 10:55:56
Done.
|
| + DLOG(WARNING) << "Failed to prepare endpoint buffers with silence."; |
| + return; |
| + } |
| + } |
| + num_written_frames_ = endpoint_render_buffer_size_frames_; |
| // Start output streaming data between the endpoint buffer and the audio |
| // engine. |