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

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

Issue 2352623002: AcmReceiver::DecoderByPayloadType: Ask NetEq for decoder (Closed)
Patch Set: Created 4 years, 3 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/acm2/acm_receiver_unittest_oldapi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/acm2/acm_receiver.cc
diff --git a/webrtc/modules/audio_coding/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
index b89091f3626374d8f3fe0693c5437f8b2e989d2e..042e8c9f38f3c47356942f87ac4f64438756ada5 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receiver.cc
+++ b/webrtc/modules/audio_coding/acm2/acm_receiver.cc
@@ -314,19 +314,15 @@ void AcmReceiver::GetNetworkStatistics(NetworkStatistics* acm_stat) {
int AcmReceiver::DecoderByPayloadType(uint8_t payload_type,
CodecInst* codec) const {
rtc::CritScope lock(&crit_sect_);
- auto it = decoders_.find(payload_type);
- if (it == decoders_.end()) {
+ const rtc::Optional<CodecInst> ci = neteq_->GetDecoder(payload_type);
+ if (ci) {
+ *codec = *ci;
+ return 0;
+ } else {
LOG(LERROR) << "AcmReceiver::DecoderByPayloadType "
<< static_cast<int>(payload_type);
return -1;
}
- const Decoder& decoder = it->second;
- *codec = *RentACodec::CodecInstById(
- *RentACodec::CodecIdFromIndex(decoder.acm_codec_id));
- codec->pltype = decoder.payload_type;
- codec->channels = decoder.channels;
- codec->plfreq = decoder.sample_rate_hz;
- return 0;
}
int AcmReceiver::EnableNack(size_t max_nack_list_size) {
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/acm2/acm_receiver_unittest_oldapi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698