Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1290)

Unified Diff: content/renderer/media/audio_renderer_mixer_manager.cc

Issue 11889041: Fix VirtualAudioInputStream callback timing issues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/audio/virtual_audio_input_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | media/audio/virtual_audio_input_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698