Corrected the initialization of the AEC3

This CL corrects the initialization of the AEC3, as well 
as for the other submodules in the whole audio processing module
in the sense that it properly update the submodule states also
for the case when reinitialization is trigger from the render
side of the audio processing module.

Bug: chromium:736889,webrtc:7879
Change-Id: I423e963835d0c3227caa8e186b29031bcb912515
Reviewed-on: https://chromium-review.googlesource.com/549315
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18784}
This commit is contained in:
Per Åhgren 2017-06-27 16:00:38 +02:00 committed by Commit Bot
parent 267041c470
commit 4bdced5d93
5 changed files with 8 additions and 5 deletions

View File

@ -1 +1 @@
31f83357d6f5a78c7eb828c8073ce35f7cd2b1fa
19e4b68ee2fecd4652fde54d43b6331ef90f3ef1

View File

@ -1 +1 @@
c2907879eee3f1abeeb1fe2e29dd25bdb4ef5961
64802f0a924f23b86a91d8d9d181bffe3f02c308

View File

@ -1 +1 @@
eb0db8379eb703a49cd08d6c5c53a15a6cfc6b9f
98249662a7ba79579a199a8b9ef9f6fc26ff33aa

View File

@ -470,6 +470,8 @@ int AudioProcessingImpl::MaybeInitialize(
}
int AudioProcessingImpl::InitializeLocked() {
UpdateActiveSubmoduleStates();
const int capture_audiobuffer_num_channels =
capture_nonlocked_.beamformer_enabled
? formats_.api_format.input_stream().num_channels()
@ -565,6 +567,8 @@ int AudioProcessingImpl::InitializeLocked() {
}
int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
UpdateActiveSubmoduleStates();
for (const auto& stream : config.streams) {
if (stream.num_channels() > 0 && stream.sample_rate_hz() <= 0) {
return kBadSampleRateError;

View File

@ -45,8 +45,7 @@ TEST(AudioProcessingImplTest, AudioParameterChangeTriggersInit) {
// Call with the default parameters; there should be an init.
frame.num_channels_ = 1;
SetFrameSampleRate(&frame, 16000);
EXPECT_CALL(mock, InitializeLocked())
.Times(1);
EXPECT_CALL(mock, InitializeLocked()).Times(0);
EXPECT_NOERR(mock.ProcessStream(&frame));
EXPECT_NOERR(mock.ProcessReverseStream(&frame));