Merge the preambles of the ProcessStream implementations

The two functions have a lot of shared logic and locking. This CL consolidates that into a single function.

Bug: webrtc:111235
Change-Id: Ib1c32165dbf0e212c7d4b0753bcbb5ffd05eb6fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163022
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30144}
This commit is contained in:
Sam Zackrisson
2020-01-03 14:54:20 +01:00
committed by Commit Bot
parent 0f14db22de
commit 12e319aafe
4 changed files with 51 additions and 93 deletions

View File

@ -832,13 +832,9 @@ TEST_F(ApmTest, Channels) {
}
TEST_F(ApmTest, SampleRatesInt) {
// Testing invalid sample rates
SetContainerFormat(10000, 2, &frame_, &float_cb_);
EXPECT_EQ(apm_->kBadSampleRateError, ProcessStreamChooser(kIntFormat));
// Testing valid sample rates
int fs[] = {8000, 16000, 32000, 48000};
for (size_t i = 0; i < arraysize(fs); i++) {
SetContainerFormat(fs[i], 2, &frame_, &float_cb_);
// Testing some valid sample rates.
for (int sample_rate : {8000, 12000, 16000, 32000, 44100, 48000, 96000}) {
SetContainerFormat(sample_rate, 2, &frame_, &float_cb_);
EXPECT_NOERR(ProcessStreamChooser(kIntFormat));
}
}