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

Unified Diff: media/audio/audio_output_controller.cc

Issue 16189009: Reduce wait time for Windows in AudioOutputController:WaitTillDataReady() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove histogram change as asked Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_controller.cc
diff --git a/media/audio/audio_output_controller.cc b/media/audio/audio_output_controller.cc
index 9e7893c06588860ca8b414e28c176e6cb28a2cd3..350c5a14256938fbcc752cd5fc0b06f64fba5e1b 100644
--- a/media/audio/audio_output_controller.cc
+++ b/media/audio/audio_output_controller.cc
@@ -313,16 +313,11 @@ void AudioOutputController::WaitTillDataReady() {
return;
base::TimeTicks start = base::TimeTicks::Now();
+ const base::TimeDelta kMaxWait = base::TimeDelta::FromMilliseconds(20);
#if defined(OS_WIN)
- // Wait for up to 683ms for DataReady(). 683ms was chosen because it's larger
- // than the playback time of the WaveOut buffer size using the minimum
- // supported sample rate: 2048 / 3000 = ~683ms.
- // TODO(davemoore): We think this can be reduced to 20ms based on
- // http://crrev.com/180102 but will do that in separate cl for mergability.
- const base::TimeDelta kMaxWait = base::TimeDelta::FromMilliseconds(683);
+ // Sleep(0) on windows lets the other threads run.
const base::TimeDelta kSleep = base::TimeDelta::FromMilliseconds(0);
#else
- const base::TimeDelta kMaxWait = base::TimeDelta::FromMilliseconds(20);
// We want to sleep for a bit here, as otherwise a backgrounded renderer won't
// get enough cpu to send the data and the high priority thread in the browser
// will use up a core causing even more skips.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698