summaryrefslogtreecommitdiffstats
path: root/media/audio/win/audio_manager_win.cc
diff options
context:
space:
mode:
authorenal@chromium.org <enal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-11 20:12:21 +0000
committerenal@chromium.org <enal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-11 20:12:21 +0000
commit9f800cd4d626831e7002f2b62f480ce97d8e2857 (patch)
tree6d27b512c8b71cd52f890467b55b23228c95fcd6 /media/audio/win/audio_manager_win.cc
parent58d30658470cfd5e49b4eab9c06c598ffc4474e8 (diff)
downloadchromium_src-9f800cd4d626831e7002f2b62f480ce97d8e2857.zip
chromium_src-9f800cd4d626831e7002f2b62f480ce97d8e2857.tar.gz
chromium_src-9f800cd4d626831e7002f2b62f480ce97d8e2857.tar.bz2
Do not stop audio physical stream immediately after logical one had stopped.
Wait some time. We are still stopping/closing the stream, as (1) it is better for battery life, and (2) some people can hear active device even when it is playing silence. That increased audio startup latency, especially on Windows, because we are using 3 buffers on Windows. To fix that I changed the code to use 2 buffers on presumable good Windows boxes -- i.e. running non-Vista and having more than single core. Changed unit tests as well. BUG=129190 TEST=Should not be noticeable difference in behavior. Run tests on Win7 and XP myself. Review URL: https://chromiumcodereview.appspot.com/10540034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/win/audio_manager_win.cc')
-rw-r--r--media/audio/win/audio_manager_win.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc
index 93dcf2f..38c4615 100644
--- a/media/audio/win/audio_manager_win.cc
+++ b/media/audio/win/audio_manager_win.cc
@@ -244,7 +244,10 @@ AudioOutputStream* AudioManagerWin::MakeLinearOutputStream(
if (params.channels() > kWinMaxChannels)
return NULL;
- return new PCMWaveOutAudioOutputStream(this, params, 3, WAVE_MAPPER);
+ return new PCMWaveOutAudioOutputStream(this,
+ params,
+ media::NumberOfWaveOutBuffers(),
+ WAVE_MAPPER);
}
// Factory for the implementations of AudioOutputStream for