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

Unified Diff: webrtc/modules/audio_coding/neteq/neteq_impl.cc

Issue 1319683002: AudioDecoder: Replace Init() with Reset() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@buffer
Patch Set: review fixes Created 5 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/neteq_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index 22e71f7f1d8af82f80d3f46c38cf465c84da7f4e..cf7afbc8d93b5e40ca2e77634168ca06dc7e6d69 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -1178,15 +1178,14 @@ int NetEqImpl::Decode(PacketList* packet_list, Operations* operation,
if (reset_decoder_) {
// TODO(hlundin): Write test for this.
- // Reset decoder.
- if (decoder) {
- decoder->Init();
- }
+ if (decoder)
+ decoder->Reset();
+
// Reset comfort noise decoder.
AudioDecoder* cng_decoder = decoder_database_->GetActiveCngDecoder();
- if (cng_decoder) {
- cng_decoder->Init();
- }
+ if (cng_decoder)
+ cng_decoder->Reset();
+
reset_decoder_ = false;
}
@@ -1896,11 +1895,9 @@ void NetEqImpl::SetSampleRateAndChannels(int fs_hz, size_t channels) {
mute_factor_array_[i] = 16384; // 1.0 in Q14.
}
- // Reset comfort noise decoder, if there is one active.
AudioDecoder* cng_decoder = decoder_database_->GetActiveCngDecoder();
- if (cng_decoder) {
- cng_decoder->Init();
- }
+ if (cng_decoder)
+ cng_decoder->Reset();
// Reinit post-decode VAD with new sample rate.
assert(vad_.get()); // Cannot be NULL here.

Powered by Google App Engine
This is Rietveld 408576698