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-12 22:55:50 +0000
committerenal@chromium.org <enal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-12 22:55:50 +0000
commit0d8ca3bb6a5f639eb108500b59d0a7c74a8632bc (patch)
tree47fb33472db665577d710ecf902e2c7b2fb4e051 /media/audio/win/audio_manager_win.cc
parent23b2854f265e8d65d269509464bee5166540bf53 (diff)
downloadchromium_src-0d8ca3bb6a5f639eb108500b59d0a7c74a8632bc.zip
chromium_src-0d8ca3bb6a5f639eb108500b59d0a7c74a8632bc.tar.gz
chromium_src-0d8ca3bb6a5f639eb108500b59d0a7c74a8632bc.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. That CL finishes work on browser-side audio mixer. Not sure how important it is, though -- hopefully it will provide some time while implementing renderer-side mixer. Also moved code for crash Mac OS X into audio mixer, because problem can manifest itself if Close() called immediately after Stop(). That CL also fixes bug 131720. Looks that it was caused by timing change, and starting stream earlier causes less dropped frames. (I still cannot understand why on modern system we should have even single dropped frame, and why slight timing change caused us to drop frame, but that is different question...) BUG=129190 BUG=131720 BUG=131720 BUG=102395 TEST=Should not be noticeable difference in behavior. Run tests on Win7 and XP myself. TEST=Mac crashes on seeks should go away, too. Review URL: https://chromiumcodereview.appspot.com/10540034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141770 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