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:
parent
49a862ec4c
commit
1d83f1e89f
@ -848,13 +848,10 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
|
|||||||
// in combination with Open SL ES audio.
|
// in combination with Open SL ES audio.
|
||||||
const bool built_in_aec = voe_wrapper_->hw()->BuiltInAECIsAvailable();
|
const bool built_in_aec = voe_wrapper_->hw()->BuiltInAECIsAvailable();
|
||||||
if (built_in_aec) {
|
if (built_in_aec) {
|
||||||
// Enabled built-in EC if the device has one and delay agnostic AEC is not
|
// Built-in EC exists on this device. Enable/Disable it according to the
|
||||||
// enabled.
|
// echo_cancellation audio option.
|
||||||
const bool enable_built_in_aec = echo_cancellation &
|
if (voe_wrapper_->hw()->EnableBuiltInAEC(echo_cancellation) == 0 &&
|
||||||
!use_delay_agnostic_aec;
|
echo_cancellation) {
|
||||||
// Set mode of built-in EC according to the audio options.
|
|
||||||
voe_wrapper_->hw()->EnableBuiltInAEC(enable_built_in_aec);
|
|
||||||
if (enable_built_in_aec) {
|
|
||||||
// Disable internal software EC if built-in EC is enabled,
|
// Disable internal software EC if built-in EC is enabled,
|
||||||
// i.e., replace the software EC with the built-in EC.
|
// i.e., replace the software EC with the built-in EC.
|
||||||
options.echo_cancellation.Set(false);
|
options.echo_cancellation.Set(false);
|
||||||
|
@ -579,7 +579,7 @@ if (!_shared->statistics().Initialized()) {
|
|||||||
int VoEHardwareImpl::EnableBuiltInAEC(bool enable) {
|
int VoEHardwareImpl::EnableBuiltInAEC(bool enable) {
|
||||||
if (!_shared->statistics().Initialized()) {
|
if (!_shared->statistics().Initialized()) {
|
||||||
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
_shared->SetLastError(VE_NOT_INITED, kTraceError);
|
||||||
return false;
|
return -1;
|
||||||
}
|
}
|
||||||
return _shared->audio_device()->EnableBuiltInAEC(enable);
|
return _shared->audio_device()->EnableBuiltInAEC(enable);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user