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

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

Issue 11568021: Merge 169553 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years 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
« no previous file with comments | « media/audio/audio_output_resampler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/waveout_output_win.cc
===================================================================
--- media/audio/win/waveout_output_win.cc (revision 172971)
+++ media/audio/win/waveout_output_win.cc (working copy)
@@ -76,7 +76,6 @@
return reinterpret_cast<WAVEHDR*>(&buffers_[n * BufferSize()]);
}
-
PCMWaveOutAudioOutputStream::PCMWaveOutAudioOutputStream(
AudioManagerWin* manager, const AudioParameters& params, int num_buffers,
UINT device_id)
@@ -342,6 +341,13 @@
// 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 backend, we run into synchronization issues where
+ // 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();
+
// TODO(sergeyu): Specify correct hardware delay for AudioBuffersState.
int frames_filled = callback_->OnMoreData(
audio_bus_.get(), AudioBuffersState(pending_bytes_, 0));
« no previous file with comments | « media/audio/audio_output_resampler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698