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}
This commit is contained in:
kwiberg
2016-06-02 02:58:59 -07:00
committed by Commit bot
parent 52033d6ea1
commit abe95ba323
10 changed files with 24 additions and 52 deletions

View File

@ -45,8 +45,9 @@ int32_t AudioCoder::SetEncodeCodec(const CodecInst& codec_inst) {
}
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));