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

Unified Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc

Issue 1908923002: Audio Coding Module: Use separate instances for 16 kHz and 32 kHz iSAC decoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: New test checksums for non-ARM platforms Created 4 years, 8 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/acm2/audio_coding_module_impl.cc
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc
index f00b2432f2430a47bfb67be58c276539107f9a53..1a1ae37a8a38da869caa30fc78539ccb49c11028 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module_impl.cc
@@ -719,10 +719,12 @@ int AudioCodingModuleImpl::RegisterReceiveCodecUnlocked(
AudioDecoder* isac_decoder = nullptr;
if (STR_CASE_CMP(codec.plname, "isac") == 0) {
- if (!isac_decoder_) {
- isac_decoder_ = isac_factory();
+ std::unique_ptr<AudioDecoder>& saved_isac_decoder =
+ codec.plfreq == 16000 ? isac_decoder_16k_ : isac_decoder_32k_;
+ if (!saved_isac_decoder) {
+ saved_isac_decoder = isac_factory();
}
- isac_decoder = isac_decoder_.get();
+ isac_decoder = saved_isac_decoder.get();
}
return receiver_.AddCodec(*codec_index, codec.pltype, codec.channels,
codec.plfreq, isac_decoder, codec.plname);

Powered by Google App Engine
This is Rietveld 408576698