From ccfc93913ce015309429ea07ddf24808f111efb9 Mon Sep 17 00:00:00 2001 From: Bjorn Volcker Date: Thu, 7 May 2015 07:43:17 +0200 Subject: [PATCH] Reinterpret AudioOption delay_agnostic_aec to override HW-AEC This CL will change the behavior when enabling Delay Agnostic AEC through the media constraint (and AudioOption delay_agnostic_aec) FROM Use DA-AEC instead of AECM if there is no HW-AEC TO Use DA-AEC even if there is a HW-AEC Before this change the user will not really know if the Delay Agnostic AEC is running or not, so it is more intuitive if the option overrides the built-in one if the user has asked for it. BUG=4472 TESTED=locally with a modified AppRTCDemo app R=tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/49859004 Cr-Commit-Position: refs/heads/master@{#9147} --- talk/media/webrtc/webrtcvoiceengine.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc index 411872ad42..74a4b25606 100644 --- a/talk/media/webrtc/webrtcvoiceengine.cc +++ b/talk/media/webrtc/webrtcvoiceengine.cc @@ -850,9 +850,10 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { // TODO(henrika): investigate possibility to support built-in EC also // in combination with Open SL ES audio. const bool built_in_aec = voe_wrapper_->hw()->BuiltInAECIsAvailable(); - if (built_in_aec) { - // Built-in EC exists on this device. Enable/Disable it according to the - // echo_cancellation audio option. + if (built_in_aec && !use_delay_agnostic_aec) { + // Built-in EC exists on this device and use_delay_agnostic_aec is not + // overriding it. Enable/Disable it according to the echo_cancellation + // audio option. if (voe_wrapper_->hw()->EnableBuiltInAEC(echo_cancellation) == 0 && echo_cancellation) { // Disable internal software EC if built-in EC is enabled,