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

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: Make sure the diffs are calculated properly as signed. Also use auto. 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
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..51098b6213875402f73e23d7e9a87bd4db131ff8 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();
hlundin-webrtc 2016/08/26 11:34:46 Join the type with the asterisk.
kwiberg-webrtc 2016/08/26 11:40:57 Better yet, get in the habit of running git cl for
ossu 2016/08/26 11:47:31 I often do that on single statements I add - mostl
kwiberg-webrtc 2016/08/26 12:30:07 I make sure to commit locally when I'm done, then
hlundin-webrtc 2016/08/26 12:41:50 Sisyphus as well as Don Quixote spring to mind...
+ 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.

Powered by Google App Engine
This is Rietveld 408576698