From 5b830fed077043df01e162dd9c58dac9b27714ea Mon Sep 17 00:00:00 2001 From: Alex Luebs Date: Tue, 8 Mar 2016 17:52:52 +0100 Subject: [PATCH] Drop the restriction on same forward and reverse sample rate on the AudioFrame interface of the APM R=peah@webrtc.org Review URL: https://codereview.webrtc.org/1766233003 . Cr-Commit-Position: refs/heads/master@{#11913} --- webrtc/modules/audio_processing/audio_processing_impl.cc | 5 ----- .../audio_processing/audio_processing_impl_unittest.cc | 8 +++----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc index 3c67a9bf28..e849822720 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl.cc @@ -875,11 +875,6 @@ int AudioProcessingImpl::AnalyzeReverseStream(AudioFrame* frame) { frame->sample_rate_hz_ != kSampleRate48kHz) { return kBadSampleRateError; } - // This interface does not tolerate different forward and reverse rates. - if (frame->sample_rate_hz_ != - formats_.api_format.input_stream().sample_rate_hz()) { - return kBadSampleRateError; - } if (frame->num_channels_ <= 0) { return kBadNumberChannelsError; diff --git a/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc b/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc index ed20daaa61..965e7eb60b 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl_unittest.cc @@ -65,12 +65,10 @@ TEST(AudioProcessingImplTest, AudioParameterChangeTriggersInit) { frame.num_channels_ = 2; EXPECT_NOERR(mock.AnalyzeReverseStream(&frame)); - // A new sample rate passed to AnalyzeReverseStream should be an error and - // not cause an init. + // A new sample rate passed to AnalyzeReverseStream should cause an init. SetFrameSampleRate(&frame, 16000); - EXPECT_CALL(mock, InitializeLocked()) - .Times(0); - EXPECT_EQ(mock.kBadSampleRateError, mock.AnalyzeReverseStream(&frame)); + EXPECT_CALL(mock, InitializeLocked()).Times(1); + EXPECT_NOERR(mock.AnalyzeReverseStream(&frame)); } } // namespace webrtc