Index: webrtc/modules/audio_processing/audio_processing_impl.cc |
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc |
index 9c587c25c7940b1cebb230caba6d6ea807eba628..c83644f517e8b00e94b548271ab4c6d85864a54f 100644 |
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc |
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc |
@@ -715,7 +715,22 @@ int AudioProcessingImpl::ProcessStreamLocked() { |
public_submodules_->high_pass_filter->ProcessCaptureAudio(ca); |
RETURN_ON_ERR(public_submodules_->gain_control->AnalyzeCaptureAudio(ca)); |
public_submodules_->noise_suppression->AnalyzeCaptureAudio(ca); |
- RETURN_ON_ERR(public_submodules_->echo_cancellation->ProcessCaptureAudio(ca)); |
+ |
+ // Ensure that not both the AEC and AECM are active at the same time. |
+ // TODO(peah): Simplify once the public API Enable functions for these |
+ // are moved to APM. |
+ RETURN_ON_ERR((public_submodules_->echo_cancellation->is_enabled() && |
hlundin-webrtc
2016/03/07 16:03:08
You don't have to use RETURN_ON_ERR here, since yo
peah-webrtc
2016/03/08 06:05:08
You are definitely right on that. It is just that
peah-webrtc
2016/03/08 06:05:08
Done.
hlundin-webrtc
2016/03/08 12:39:23
I think the code is nicer without the macro.
|
+ public_submodules_->echo_control_mobile->is_enabled() |
+ ? AudioProcessing::kBadParameterError |
+ : AudioProcessing::kNoError)); |
+ |
+ // Ensure that the stream delay was set before the call to the |
+ // AEC ProcessCaptureAudio function. |
+ RETURN_ON_ERR((was_stream_delay_set() ? AudioProcessing::kNoError |
hlundin-webrtc
2016/03/07 16:03:08
Same as above.
peah-webrtc
2016/03/08 06:05:08
Done.
|
+ : AudioProcessing::kBadParameterError)); |
+ |
+ RETURN_ON_ERR(public_submodules_->echo_cancellation->ProcessCaptureAudio( |
+ ca, stream_delay_ms())); |
if (public_submodules_->echo_control_mobile->is_enabled() && |
public_submodules_->noise_suppression->is_enabled()) { |
@@ -1251,7 +1266,9 @@ void AudioProcessingImpl::InitializeNoiseSuppression() { |
} |
void AudioProcessingImpl::InitializeEchoCanceller() { |
- public_submodules_->echo_cancellation->Initialize(); |
+ public_submodules_->echo_cancellation->Initialize( |
+ proc_sample_rate_hz(), num_reverse_channels(), num_output_channels(), |
+ num_proc_channels()); |
} |
void AudioProcessingImpl::InitializeLevelEstimator() { |