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

Unified Diff: media/audio/win/core_audio_util_win.cc

Issue 12049070: Avoids irregular OnMoreData callbacks on Windows using Core Audio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleaned up Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/win/core_audio_util_win.cc
diff --git a/media/audio/win/core_audio_util_win.cc b/media/audio/win/core_audio_util_win.cc
index 2c262b4e72d37026199881a3fdaae3ef37601964..912085d2d9cea75d88299c172a67542d11be1424 100644
--- a/media/audio/win/core_audio_util_win.cc
+++ b/media/audio/win/core_audio_util_win.cc
@@ -549,34 +549,6 @@ ScopedComPtr<IAudioRenderClient> CoreAudioUtil::CreateRenderClient(
DVLOG(1) << "IAudioClient::GetService: " << std::hex << hr;
return ScopedComPtr<IAudioRenderClient>();
}
-
- // TODO(henrika): verify that this scheme is the same for shared mode and
- // exclusive mode streams.
-
- // Avoid start-up glitches by filling up the endpoint buffer with "silence"
- // before starting the stream.
- UINT32 endpoint_buffer_size = 0;
- hr = client->GetBufferSize(&endpoint_buffer_size);
- DVLOG_IF(1, FAILED(hr)) << "IAudioClient::GetBufferSize: " << std::hex << hr;
-
- BYTE* data = NULL;
- hr = audio_render_client->GetBuffer(endpoint_buffer_size, &data);
- DVLOG_IF(1, FAILED(hr)) << "IAudioRenderClient::GetBuffer: "
- << std::hex << hr;
- if (SUCCEEDED(hr)) {
- // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to
- // explicitly write silence data to the rendering buffer.
- hr = audio_render_client->ReleaseBuffer(endpoint_buffer_size,
- AUDCLNT_BUFFERFLAGS_SILENT);
- DVLOG_IF(1, FAILED(hr)) << "IAudioRenderClient::ReleaseBuffer: "
- << std::hex << hr;
- }
-
- // Sanity check: verify that the endpoint buffer is filled with silence.
- UINT32 num_queued_frames = 0;
- client->GetCurrentPadding(&num_queued_frames);
- DCHECK(num_queued_frames == endpoint_buffer_size);
-
return audio_render_client;
}
« media/audio/win/audio_unified_win.cc ('K') | « media/audio/win/audio_unified_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698