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

Unified Diff: media/audio/audio_output_controller.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/audio_output_controller.cc
diff --git a/media/audio/audio_output_controller.cc b/media/audio/audio_output_controller.cc
index f21da8fb75f429574aa11819d068c06b2a40adc2..a0bb92f01606861b5c91f46b7455747d7613d13c 100644
--- a/media/audio/audio_output_controller.cc
+++ b/media/audio/audio_output_controller.cc
@@ -319,17 +319,8 @@ int AudioOutputController::OnMoreIOData(AudioBus* source,
}
void AudioOutputController::WaitTillDataReady() {
- if (!sync_reader_->DataReady()) {
- // In the different place we use different mechanism to poll, get max
- // polling delay from constants used there.
- const base::TimeDelta kMaxPollingDelay = TimeDelta::FromMilliseconds(
- kPollNumAttempts * kPollPauseInMilliseconds);
- Time start_time = Time::Now();
- do {
- base::PlatformThread::Sleep(TimeDelta::FromMilliseconds(1));
- } while (!sync_reader_->DataReady() &&
- Time::Now() - start_time < kMaxPollingDelay);
- }
+ while (!sync_reader_->DataReady())
scherkus (not reviewing) 2012/11/21 21:37:57 how about backing up your comments w/ something li
DaleCurtis 2012/11/21 22:42:10 We'll need OS_MAC in there too for now since the h
+ base::PlatformThread::YieldCurrentThread();
Chris Rogers 2012/11/21 19:33:37 We should probably check that this while is not sp
scherkus (not reviewing) 2012/11/21 21:37:57 perhaps a CHECK()-timeout and monitor for any repo
DaleCurtis 2012/11/21 22:42:10 CHECK() worries me, I've added a 1.5 second timeou
}
void AudioOutputController::OnError(AudioOutputStream* stream, int code) {

Powered by Google App Engine
This is Rietveld 408576698