Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: webrtc/modules/audio_coding/neteq/decoder_database.h

Issue 2270063006: TimestampScaler no longer depends on NetEqDecoder to figure out scaling. (Closed)
Patch Set: Moved a *, turned diffs to const. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/timestamp_scaler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/decoder_database.h
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database.h b/webrtc/modules/audio_coding/neteq/decoder_database.h
index 14548749bf83095953377f6072ab9b570770bfbd..6d277c95c9f013525a5fcede31ae0f236ee12021 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database.h
+++ b/webrtc/modules/audio_coding/neteq/decoder_database.h
@@ -59,10 +59,14 @@ class DecoderDatabase {
void DropDecoder() const { decoder_.reset(); }
int SampleRateHz() const {
- RTC_DCHECK_EQ(1, !!decoder_ + !!external_decoder_ + !!cng_decoder_);
- return decoder_ ? decoder_->SampleRateHz()
- : external_decoder_ ? external_decoder_->SampleRateHz()
- : cng_decoder_->sample_rate_hz;
+ const AudioDecoder* decoder = GetDecoder();
+ RTC_DCHECK_EQ(1, !!decoder + !!cng_decoder_);
+ return decoder ? decoder->SampleRateHz() : cng_decoder_->sample_rate_hz;
+ }
+
+ const SdpAudioFormat& GetFormat() const {
+ RTC_DCHECK(audio_format_);
+ return *audio_format_;
}
// Returns true if |codec_type| is comfort noise.
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/timestamp_scaler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698