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}
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index 87d12f5..b8e8c71 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -761,9 +761,10 @@
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 @@
}
// 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_;