Index: content/renderer/media/audio_renderer_mixer_manager.cc |
diff --git a/content/renderer/media/audio_renderer_mixer_manager.cc b/content/renderer/media/audio_renderer_mixer_manager.cc |
index 05782d231fb618d66e8e824388f045e8866185db..86d482960f9675a83bfd11d0cdcb73eaa302b5f8 100644 |
--- a/content/renderer/media/audio_renderer_mixer_manager.cc |
+++ b/content/renderer/media/audio_renderer_mixer_manager.cc |
@@ -52,12 +52,24 @@ media::AudioRendererMixer* AudioRendererMixerManager::GetMixer( |
return it->second.mixer; |
} |
+ int buffer_size = hardware_buffer_size_; |
+ |
+// TODO(justinlin): Enable this on other platforms when renderer side mixing |
+// is enabled for them if we don't have renderer side device changes yet. |
+#if defined(OS_WIN) || defined(OS_MACOSX) |
+ // Force at least a 2048 buffer size until we have renderer-side device |
+ // changes. Audio mirroring will use the input device's buffer size to |
+ // drive mirroring, so we need the output device's buffer size to be big |
+ // enough to avoid garbled audio. |
+ buffer_size = std::max(hardware_buffer_size_, 2048); |
miu
2013/01/16 22:56:57
Why not make this a function of hardware_sample_ra
|
+#endif |
+ |
// Create output parameters based on the audio hardware configuration for |
// passing on to the output sink. Force to 16-bit output for now since we |
// know that works well for WebAudio and WebRTC. |
media::AudioParameters output_params( |
media::AudioParameters::AUDIO_PCM_LOW_LATENCY, params.channel_layout(), |
- hardware_sample_rate_, 16, hardware_buffer_size_); |
+ hardware_sample_rate_, 16, buffer_size); |
// If we've created invalid output parameters, simply pass on the input params |
// and let the browser side handle automatic fallback. |