From ceb9d0cc290501403f268f06c0f779c8ea152f7a Mon Sep 17 00:00:00 2001 From: kwiberg Date: Wed, 15 Jun 2016 05:55:17 -0700 Subject: [PATCH] Audio decoder factory test: Ensure that g722's sample rate is 16 kHz, not 8 kHz Review-Url: https://codereview.webrtc.org/2068133002 Cr-Commit-Position: refs/heads/master@{#13153} --- .../codecs/audio_decoder_factory_unittest.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/webrtc/modules/audio_coding/codecs/audio_decoder_factory_unittest.cc b/webrtc/modules/audio_coding/codecs/audio_decoder_factory_unittest.cc index 50503dd13f..9b5336927d 100644 --- a/webrtc/modules/audio_coding/codecs/audio_decoder_factory_unittest.cc +++ b/webrtc/modules/audio_coding/codecs/audio_decoder_factory_unittest.cc @@ -55,12 +55,6 @@ TEST(AudioDecoderFactoryTest, CreateIlbc) { EXPECT_TRUE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 1))); EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 2))); EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 16000, 1))); - - // iLBC actually uses a 16 kHz sample rate instead of the nominal 8 kHz. - // TODO(kwiberg): Uncomment this once AudioDecoder has a SampleRateHz method. - // std::unique_ptr dec = - // adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 1)); - // EXPECT_EQ(16000, dec->SampleRateHz()); } TEST(AudioDecoderFactoryTest, CreateIsac) { @@ -108,6 +102,11 @@ TEST(AudioDecoderFactoryTest, CreateG722) { EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("g722", 8000, 3))); EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("g722", 16000, 1))); EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("g722", 32000, 1))); + + // g722 actually uses a 16 kHz sample rate instead of the nominal 8 kHz. + std::unique_ptr dec = + adf->MakeAudioDecoder(SdpAudioFormat("g722", 8000, 1)); + EXPECT_EQ(16000, dec->SampleRateHz()); } TEST(AudioDecoderFactoryTest, CreateOpus) {