summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorxians <xians@chromium.org>2014-11-12 18:15:52 +0100
committerxians <xians@chromium.org>2014-11-12 17:16:56 +0000
commit31bb082725d4ff36aa24e9a680da4ac1fb400934 (patch)
tree050d9d0c2952ab1ec24fb9b4d17567cbe29eca14 /content
parent9cfbcfb3e00697d3663a5dbf4fd8c81ae6970d97 (diff)
downloadchromium_src-31bb082725d4ff36aa24e9a680da4ac1fb400934.zip
chromium_src-31bb082725d4ff36aa24e9a680da4ac1fb400934.tar.gz
chromium_src-31bb082725d4ff36aa24e9a680da4ac1fb400934.tar.bz2
Avoid getting CoreAudio into bad state.
This patch fixes two issues: 1) in audio_low_latency_input_mac.cc, when the number_of_frames is changed on the fly, previously we feed a audio_buffer_list which uses the original number_of_frames_ to CoreAudio, this will put CoreAudio into a bad state, and the consequence is that if the new input stream is trying to use a larger buffer size than what the previous input stream was using, AudioUnitRender() will return -50 for the new stream. Thus it leads to no input audio issue for webrtc. 2) gUM on Mac will create an input stream using 128 samples as buffer size at the beginning, and will re-create the stream using 10ms when a peer connection is connected to a audio track. It discards if audio processing is enabled or not. This patch avoids creating the first stream using 128 samples if audio processing is enabled. BUG=428706 TEST=https://webrtc-phone.appspot.com changes chrome3940Workaround to false, and make a call lots of time. Verify that the input stream always works. R=henrika@chromium.org, tommi@chromium.org Review URL: https://codereview.chromium.org/720713002 Cr-Commit-Position: refs/heads/master@{#303848}
Diffstat (limited to 'content')
-rw-r--r--content/renderer/media/webrtc_audio_capturer.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc
index 3299987..45034e8 100644
--- a/content/renderer/media/webrtc_audio_capturer.cc
+++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -579,10 +579,13 @@ int WebRtcAudioCapturer::GetBufferSize(int sample_rate) const {
// Use the native hardware buffer size in non peer connection mode when the
// platform is using a native buffer size smaller than the PeerConnection
- // buffer size.
+ // buffer size and audio processing is off.
int hardware_buffer_size = device_info_.device.input.frames_per_buffer;
if (!peer_connection_mode_ && hardware_buffer_size &&
- hardware_buffer_size <= peer_connection_buffer_size) {
+ hardware_buffer_size <= peer_connection_buffer_size &&
+ !audio_processor_->has_audio_processing()) {
+ DVLOG(1) << "WebRtcAudioCapturer is using hardware buffer size "
+ << hardware_buffer_size;
return hardware_buffer_size;
}