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

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: comments 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') | media/audio/virtual_audio_input_stream.cc » ('J')
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..339f6aea60bc3fc18d6c2c1b6689466cc3553aa3 100644
--- a/content/renderer/media/audio_renderer_mixer_manager.cc
+++ b/content/renderer/media/audio_renderer_mixer_manager.cc
@@ -52,12 +52,21 @@ media::AudioRendererMixer* AudioRendererMixerManager::GetMixer(
return it->second.mixer;
}
+ int buffer_size = hardware_buffer_size_;
+#if defined(OS_WIN) || defined(OS_MACOSX)
miu 2013/01/15 23:28:35 Remove #if, since this would seem to apply to all
justinlin 2013/01/15 23:52:45 Renderer side mixing is only turned on for OSX/Win
miu 2013/01/16 03:43:03 It's a flag for multiple platforms, enabled by def
justinlin 2013/01/16 20:15:23 I added a TODO to do this if we don't get to rende
+ // Force at least a 1024 buffer size until we have renderer-side device
+ // changes. WebRTC audio mirroring will use the input device's buffer size to
DaleCurtis 2013/01/15 23:30:03 WebRTC doesn't use this code?
justinlin 2013/01/15 23:52:45 Done. We'd typically use audio mirroring with webr
+ // 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_, 1024);
+#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') | media/audio/virtual_audio_input_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698