NetEq decoder database: Don't keep track of sample rate for builtin decoders

This allows us to get rid of the function that computes it, which gets
us one step closer to getting rid of the NetEqDecoder type.

BUG=webrtc:5801

Review-Url: https://codereview.webrtc.org/2021063002
Cr-Commit-Position: refs/heads/master@{#12974}
This commit is contained in:
kwiberg
2016-05-31 06:28:03 -07:00
committed by Commit bot
parent 799467d753
commit c0f2dcf9ed
15 changed files with 157 additions and 198 deletions

View File

@ -761,9 +761,10 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
const DecoderDatabase::DecoderInfo* decoder_info =
decoder_database_->GetDecoderInfo(payload_type);
assert(decoder_info);
if (decoder_info->fs_hz != fs_hz_ ||
if (decoder_info->SampleRateHz() != fs_hz_ ||
channels != algorithm_buffer_->Channels()) {
SetSampleRateAndChannels(decoder_info->fs_hz, channels);
SetSampleRateAndChannels(decoder_info->SampleRateHz(),
channels);
}
if (nack_enabled_) {
RTC_DCHECK(nack_);
@ -1347,10 +1348,11 @@ int NetEqImpl::Decode(PacketList* packet_list, Operations* operation,
}
// If sampling rate or number of channels has changed, we need to make
// a reset.
if (decoder_info->fs_hz != fs_hz_ ||
if (decoder_info->SampleRateHz() != fs_hz_ ||
decoder->Channels() != algorithm_buffer_->Channels()) {
// TODO(tlegrand): Add unittest to cover this event.
SetSampleRateAndChannels(decoder_info->fs_hz, decoder->Channels());
SetSampleRateAndChannels(decoder_info->SampleRateHz(),
decoder->Channels());
}
sync_buffer_->set_end_timestamp(timestamp_);
playout_timestamp_ = timestamp_;