diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 21:01:55 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 21:01:55 +0000 |
commit | e5d699a398be02939bba2247e2c2d6843793d6fc (patch) | |
tree | 232fb7093af46104818c9b3f9a5f1f94f68dc4a7 /media | |
parent | 33d05d0f5e0c81330309341cae2caae5184178d6 (diff) | |
download | chromium_src-e5d699a398be02939bba2247e2c2d6843793d6fc.zip chromium_src-e5d699a398be02939bba2247e2c2d6843793d6fc.tar.gz chromium_src-e5d699a398be02939bba2247e2c2d6843793d6fc.tar.bz2 |
Add --waveout-buffers switch for Windows users.
Provides a fast means for debugging different WaveOut buffer counts on
Windows machines.
BUG=161307
TEST=flag results in the correct number of buffers.
Review URL: https://chromiumcodereview.appspot.com/12224016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/audio/audio_util.cc | 8 | ||||
-rw-r--r-- | media/base/media_switches.cc | 4 | ||||
-rw-r--r-- | media/base/media_switches.h | 4 |
3 files changed, 16 insertions, 0 deletions
diff --git a/media/audio/audio_util.cc b/media/audio/audio_util.cc index 3b4f9c5..c03f502 100644 --- a/media/audio/audio_util.cc +++ b/media/audio/audio_util.cc @@ -262,6 +262,14 @@ size_t GetHighLatencyOutputBufferSize(int sample_rate) { #if defined(OS_WIN) int NumberOfWaveOutBuffers() { + // Use the user provided buffer count if provided. + int buffers = 0; + std::string buffers_str(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kWaveOutBuffers)); + if (base::StringToInt(buffers_str, &buffers) && buffers > 0) { + return buffers; + } + // Use 4 buffers for Vista, 3 for everyone else: // - The entire Windows audio stack was rewritten for Windows Vista and wave // out performance was degraded compared to XP. diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index f113161..79f077a 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc @@ -66,4 +66,8 @@ const char kEnableVp9Playback[] = "enable-vp9-playback"; // with WebRTC apps for audio mirroring testing. const char kForceAudioMirroring[] = "force-audio-mirroring"; +#if defined(OS_WIN) +const char kWaveOutBuffers[] = "waveout-buffers"; +#endif + } // namespace switches diff --git a/media/base/media_switches.h b/media/base/media_switches.h index de493c0e..7460a92 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h @@ -51,6 +51,10 @@ MEDIA_EXPORT extern const char kEnableVp9Playback[]; MEDIA_EXPORT extern const char kForceAudioMirroring[]; +#if defined(OS_WIN) +MEDIA_EXPORT extern const char kWaveOutBuffers[]; +#endif + } // namespace switches #endif // MEDIA_BASE_MEDIA_SWITCHES_H_ |