Only create AECm when needed

This CL ensures that the AECm is only created when needed.
The changes in the CL are bitexact when running AECm via
audioproc_f

The CL also corrects an issue where there is a risk for
AEC2 to not be correctly setup when the sample rate
changes inbetween activations.

Bug: webrtc:8671
Change-Id: Id3b33e20969b1543e28c885d47495246cfbe549d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134216
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27800}
This commit is contained in:
Per Åhgren
2019-04-29 12:14:50 +02:00
committed by Commit Bot
parent 8a9778efa4
commit b6e24d7f35
2 changed files with 112 additions and 122 deletions

View File

@ -430,13 +430,9 @@ class AudioProcessingImpl : public AudioProcessing {
std::unique_ptr<AudioBuffer> render_audio;
} render_ RTC_GUARDED_BY(crit_render_);
size_t aec_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_)
RTC_GUARDED_BY(crit_capture_) = 0;
std::vector<float> aec_render_queue_buffer_ RTC_GUARDED_BY(crit_render_);
std::vector<float> aec_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_);
size_t aecm_render_queue_element_max_size_ RTC_GUARDED_BY(crit_render_)
RTC_GUARDED_BY(crit_capture_) = 0;
std::vector<int16_t> aecm_render_queue_buffer_ RTC_GUARDED_BY(crit_render_);
std::vector<int16_t> aecm_capture_queue_buffer_ RTC_GUARDED_BY(crit_capture_);