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

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

Issue 11348166: Always wait for DataReady() on Windows WaveOut. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only wait on WaveOut. Created 8 years, 1 month 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/waveout_output_win.cc
diff --git a/media/audio/win/waveout_output_win.cc b/media/audio/win/waveout_output_win.cc
index 5e56169a4db67d213a21e086f34777681de1209e..3da5388c13d751e678363b0cda1e58fe05708b5f 100644
--- a/media/audio/win/waveout_output_win.cc
+++ b/media/audio/win/waveout_output_win.cc
@@ -342,6 +342,13 @@ void PCMWaveOutAudioOutputStream::QueueNextPacket(WAVEHDR *buffer) {
// return to us how many bytes were used.
// TODO(fbarchard): Handle used 0 by queueing more.
+ // HACK: Yield if Read() is called too often. On older platforms which are
+ // still using the WaveOut back end, we run into synchronization issues where
scherkus (not reviewing) 2012/11/21 21:37:57 s/back end/backend/
DaleCurtis 2012/11/21 22:42:10 Done.
+ // the renderer has not finished filling the shared memory when Read() is
+ // called. Reading too early will lead to clicks and pops. See issues:
+ // http://crbug.com/161307 and http://crbug.com/61022
+ callback_->WaitTillDataReady();
DaleCurtis 2012/11/21 19:31:07 I'm digging through the WaveOut docs to see if we
+
// TODO(sergeyu): Specify correct hardware delay for AudioBuffersState.
int frames_filled = callback_->OnMoreData(
audio_bus_.get(), AudioBuffersState(pending_bytes_, 0));
« media/audio/audio_output_controller.cc ('K') | « media/audio/audio_output_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698