NetEq: Ask AudioDecoder for sample rate instead of passing it as an argument
BUG=webrtc:5801
NOTRY=true
Review-Url: https://codereview.webrtc.org/2027993002
Cr-Commit-Position: refs/heads/master@{#13162}
diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
index c15239f..bad484c 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
@@ -242,7 +242,7 @@
ret_val = neteq_->RegisterPayloadType(neteq_decoder, name, payload_type);
} else {
ret_val = neteq_->RegisterExternalDecoder(
- audio_decoder, neteq_decoder, name, payload_type, sample_rate_hz);
+ audio_decoder, neteq_decoder, name, payload_type);
}
if (ret_val != NetEq::kOK) {
LOG(LERROR) << "AcmReceiver::AddCodec " << acm_codec_id
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc
index 55cb572..ce8d86d 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_unittest_oldapi.cc
@@ -1019,6 +1019,9 @@
EXPECT_CALL(mock_decoder, IncomingPacket(_, _, _, _, _))
.Times(AtLeast(1))
.WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::IncomingPacket));
+ EXPECT_CALL(mock_decoder, SampleRateHz())
+ .Times(AtLeast(1))
+ .WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::SampleRateHz));
EXPECT_CALL(mock_decoder, Channels())
.Times(AtLeast(1))
.WillRepeatedly(Invoke(&decoder, &AudioDecoderPcmU::Channels));