Reduce wait time for Windows in AudioOutputController:WaitTillDataReady()

This timeout was long to work around a problem that has been resolved
elsewhere.
I'm also changing the histogram name to match the condensed format
that is now preferred. In addition I've added a new boolean histogram
to indicate if the data was ready or not.

BUG=244939
BUG=242726

TEST=None

Review URL: https://chromiumcodereview.appspot.com/16189009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203065 0039d316-1c4b-4281-b951-d872f2087c98
parent 4c96f62d
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment