OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 { | 171 { |
172 CriticalSectionScoped lock(crit_sect_.get()); | 172 CriticalSectionScoped lock(crit_sect_.get()); |
173 | 173 |
174 const Decoder* decoder = RtpHeaderToDecoder(*header, incoming_payload); | 174 const Decoder* decoder = RtpHeaderToDecoder(*header, incoming_payload); |
175 if (!decoder) { | 175 if (!decoder) { |
176 LOG_F(LS_ERROR) << "Payload-type " | 176 LOG_F(LS_ERROR) << "Payload-type " |
177 << static_cast<int>(header->payloadType) | 177 << static_cast<int>(header->payloadType) |
178 << " is not registered."; | 178 << " is not registered."; |
179 return -1; | 179 return -1; |
180 } | 180 } |
181 const int sample_rate_hz = ACMCodecDB::CodecFreq(decoder->acm_codec_id); | 181 const int sample_rate_hz = [&decoder] { |
| 182 const auto ci = RentACodec::CodecIdFromIndex(decoder->acm_codec_id); |
| 183 return ci ? RentACodec::CodecInstById(*ci)->plfreq : -1; |
| 184 }(); |
182 receive_timestamp = NowInTimestamp(sample_rate_hz); | 185 receive_timestamp = NowInTimestamp(sample_rate_hz); |
183 | 186 |
184 // If this is a CNG while the audio codec is not mono, skip pushing in | 187 // If this is a CNG while the audio codec is not mono, skip pushing in |
185 // packets into NetEq. | 188 // packets into NetEq. |
186 if (IsCng(decoder->acm_codec_id) && last_audio_decoder_ && | 189 if (IsCng(decoder->acm_codec_id) && last_audio_decoder_ && |
187 last_audio_decoder_->channels > 1) | 190 last_audio_decoder_->channels > 1) |
188 return 0; | 191 return 0; |
189 if (!IsCng(decoder->acm_codec_id) && | 192 if (!IsCng(decoder->acm_codec_id) && |
190 decoder->acm_codec_id != | 193 decoder->acm_codec_id != |
191 *RentACodec::CodecIndexFromId(RentACodec::CodecId::kAVT)) { | 194 *RentACodec::CodecIndexFromId(RentACodec::CodecId::kAVT)) { |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 539 |
537 void AcmReceiver::GetDecodingCallStatistics( | 540 void AcmReceiver::GetDecodingCallStatistics( |
538 AudioDecodingCallStats* stats) const { | 541 AudioDecodingCallStats* stats) const { |
539 CriticalSectionScoped lock(crit_sect_.get()); | 542 CriticalSectionScoped lock(crit_sect_.get()); |
540 *stats = call_stats_.GetDecodingStatistics(); | 543 *stats = call_stats_.GetDecodingStatistics(); |
541 } | 544 } |
542 | 545 |
543 } // namespace acm2 | 546 } // namespace acm2 |
544 | 547 |
545 } // namespace webrtc | 548 } // namespace webrtc |
OLD | NEW |