Ensure that the adaptive filter is properly adapted in AEC3
Bug: webrtc:8746
Change-Id: I087a7c629be51df6751aa44f6f7d22a6b2d46d0b
Reviewed-on: https://webrtc-review.googlesource.com/39510
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21622}
diff --git a/modules/audio_processing/aec3/aec_state.cc b/modules/audio_processing/aec3/aec_state.cc
index 00677f7..c1d7cc5 100644
--- a/modules/audio_processing/aec3/aec_state.cc
+++ b/modules/audio_processing/aec3/aec_state.cc
@@ -154,7 +154,7 @@
// TODO(peah): Move?
filter_has_had_time_to_converge_ =
- blocks_with_proper_filter_adaptation_ >= 2 * kNumBlocksPerSecond;
+ blocks_with_proper_filter_adaptation_ >= 2.5 * kNumBlocksPerSecond;
initial_state_ =
blocks_with_proper_filter_adaptation_ < 5 * kNumBlocksPerSecond;
@@ -162,7 +162,7 @@
// Flag whether the linear filter estimate is usable.
usable_linear_estimate_ =
!echo_saturation_ &&
- (converged_filter || filter_has_had_time_to_converge_) &&
+ (converged_filter && filter_has_had_time_to_converge_) &&
capture_block_counter_ >= 2 * kNumBlocksPerSecond && !TransparentMode();
// After an amount of active render samples for which an echo should have been