WebRTC Opus C interface: Add support for non-48 kHz decode sample rate
Plus tests for 16 kHz. Bug: webrtc:10631 Change-Id: I2d89bc6d0d9548f0ad7bb1e36d6dfde6b6b31f83 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138072 Commit-Queue: Karl Wiberg <kwiberg@webrtc.org> Reviewed-by: Minyue Li <minyue@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28099}
This commit is contained in:
@ -23,7 +23,7 @@ namespace webrtc {
|
||||
AudioDecoderOpusImpl::AudioDecoderOpusImpl(size_t num_channels)
|
||||
: channels_(num_channels) {
|
||||
RTC_DCHECK(num_channels == 1 || num_channels == 2);
|
||||
const int error = WebRtcOpus_DecoderCreate(&dec_state_, channels_);
|
||||
const int error = WebRtcOpus_DecoderCreate(&dec_state_, channels_, 48000);
|
||||
RTC_DCHECK(error == 0);
|
||||
WebRtcOpus_DecoderInit(dec_state_);
|
||||
}
|
||||
@ -104,7 +104,7 @@ int AudioDecoderOpusImpl::PacketDurationRedundant(const uint8_t* encoded,
|
||||
return PacketDuration(encoded, encoded_len);
|
||||
}
|
||||
|
||||
return WebRtcOpus_FecDurationEst(encoded, encoded_len);
|
||||
return WebRtcOpus_FecDurationEst(encoded, encoded_len, 48000);
|
||||
}
|
||||
|
||||
bool AudioDecoderOpusImpl::PacketHasFec(const uint8_t* encoded,
|
||||
|
||||
Reference in New Issue
Block a user