Chromium Code Reviews| Index: content/renderer/media/media_stream_audio_processor.cc |
| diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc |
| index d5314117518c5912fa0b06fb42fd0da7ce003909..6efafee18a68464870a19412088106a449725787 100644 |
| --- a/content/renderer/media/media_stream_audio_processor.cc |
| +++ b/content/renderer/media/media_stream_audio_processor.cc |
| @@ -502,8 +502,13 @@ void MediaStreamAudioProcessor::OnAec3Enable(bool enable) { |
| apm_config.echo_canceller3.enabled = enable; |
| audio_processing_->ApplyConfig(apm_config); |
| - DCHECK(echo_information_); |
| - echo_information_.reset(new EchoInformation()); |
| + if (apm_config.echo_canceller3.enabled) { |
| + // Do not log any echo information when AEC3 is active, as the echo |
| + // information then will not be properly updated. |
| + echo_information_.reset(); |
| + } else { |
| + echo_information_.reset(new EchoInformation()); |
|
Guido Urdaneta
2017/06/09 01:39:33
prefer base::MakeUnique to raw new.
You can use as
peah
2017/06/09 11:04:06
Done.
|
| + } |
| } |
| void MediaStreamAudioProcessor::OnIpcClosing() { |
| @@ -696,12 +701,18 @@ void MediaStreamAudioProcessor::InitializeAudioProcessingModule( |
| if (echo_cancellation) { |
| EnableEchoCancellation(audio_processing_.get()); |
| - // Prepare for logging echo information. If there are data remaining in |
| - // |echo_information_| we simply discard it. |
| - echo_information_.reset(new EchoInformation()); |
| - |
| apm_config.echo_canceller3.enabled = override_aec3_.value_or( |
| base::FeatureList::IsEnabled(features::kWebRtcUseEchoCanceller3)); |
| + |
| + if (!apm_config.echo_canceller3.enabled) { |
| + // Prepare for logging echo information. If there are data remaining in |
| + // |echo_information_| we simply discard it. |
| + echo_information_.reset(new EchoInformation()); |
| + } else { |
| + // Do not log any echo information when AEC3 is active, as the echo |
| + // information then will not be properly updated. |
| + echo_information_.reset(); |
|
Guido Urdaneta
2017/06/09 01:39:33
ditto
peah
2017/06/09 11:04:06
Done.
|
| + } |
| } else { |
| apm_config.echo_canceller3.enabled = false; |
| } |