diff --git a/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc b/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc index c5df82c747..8905846743 100644 --- a/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc +++ b/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc @@ -95,10 +95,10 @@ void ResidualEchoEstimator::Estimate( RTC_DCHECK(R2); const rtc::Optional delay = - aec_state.FilterDelay() - ? aec_state.FilterDelay() - : (aec_state.ExternalDelay() ? aec_state.ExternalDelay() - : rtc::Optional()); + aec_state.ExternalDelay() + ? (aec_state.FilterDelay() ? aec_state.FilterDelay() + : aec_state.ExternalDelay()) + : rtc::Optional(); // Estimate the power of the stationary noise in the render signal. RenderNoisePower(render_buffer, &X2_noise_floor_, &X2_noise_floor_counter_); @@ -115,7 +115,7 @@ void ResidualEchoEstimator::Estimate( } else { // Estimate the echo generating signal power. std::array X2; - if (aec_state.ExternalDelay() || aec_state.FilterDelay()) { + if (aec_state.ExternalDelay() && aec_state.FilterDelay()) { RTC_DCHECK(delay); const int delay_use = static_cast(*delay);