talk/media/webrtc/webrtcvoiceengine: Delay Agnostic AEC should not override HW-AEC

In https://webrtc-codereview.appspot.com/48699004/ I made the audio option delay_agnostic_aec override HW-AEC if such exists. That is not an expected behavior and is fixed in this CL.

In addition we now check if EnableBuiltInAEC() was successful before disabling the SW-AEC. This revealed a bug in that return value, also fixed here.

BUG=4472
R=henrika@webrtc.org, perkj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/47969004

Cr-Commit-Position: refs/heads/master@{#8936}
This commit is contained in:
Bjorn Volcker 2015-04-07 15:25:39 +02:00
parent 49a862ec4c
commit 1d83f1e89f
2 changed files with 5 additions and 8 deletions

View File

@ -848,13 +848,10 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
// in combination with Open SL ES audio.
const bool built_in_aec = voe_wrapper_->hw()->BuiltInAECIsAvailable();
if (built_in_aec) {
// Enabled built-in EC if the device has one and delay agnostic AEC is not
// enabled.
const bool enable_built_in_aec = echo_cancellation &
!use_delay_agnostic_aec;
// Set mode of built-in EC according to the audio options.
voe_wrapper_->hw()->EnableBuiltInAEC(enable_built_in_aec);
if (enable_built_in_aec) {
// Built-in EC exists on this device. 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,
// i.e., replace the software EC with the built-in EC.
options.echo_cancellation.Set(false);

View File

@ -579,7 +579,7 @@ if (!_shared->statistics().Initialized()) {
int VoEHardwareImpl::EnableBuiltInAEC(bool enable) {
if (!_shared->statistics().Initialized()) {
_shared->SetLastError(VE_NOT_INITED, kTraceError);
return false;
return -1;
}
return _shared->audio_device()->EnableBuiltInAEC(enable);
}