AudioDecoderIsacT: Require caller to always specify sample rate
This gets rid of the complex & icky state where the sample rate is not
yet determined.
BUG=webrtc:5801
Review-Url: https://codereview.webrtc.org/2020353003
Cr-Commit-Position: refs/heads/master@{#13011}
diff --git a/webrtc/modules/utility/source/coder.cc b/webrtc/modules/utility/source/coder.cc
index 248cd48..f2ae43e 100644
--- a/webrtc/modules/utility/source/coder.cc
+++ b/webrtc/modules/utility/source/coder.cc
@@ -45,8 +45,9 @@
}
int32_t AudioCoder::SetDecodeCodec(const CodecInst& codec_inst) {
- if (acm_->RegisterReceiveCodec(
- codec_inst, [&] { return rent_a_codec_.RentIsacDecoder(); }) == -1) {
+ if (acm_->RegisterReceiveCodec(codec_inst, [&] {
+ return rent_a_codec_.RentIsacDecoder(codec_inst.plfreq);
+ }) == -1) {
return -1;
}
memcpy(&receive_codec_, &codec_inst, sizeof(CodecInst));