Chromium Code Reviews| Index: webrtc/modules/audio_coding/acm2/audio_coding_module.cc | 
| diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc | 
| index 99b539ab6440745769efcd58606f9fc6823cf4ca..847df108d5b5f084149e7d624671656a2854e090 100644 | 
| --- a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc | 
| +++ b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc | 
| @@ -132,6 +132,9 @@ class AudioCodingModuleImpl final : public AudioCodingModule { | 
| int num_channels, | 
| const std::string& name) override; | 
| + bool RegisterReceiveCodec(int rtp_payload_type, | 
| + const SdpAudioFormat& audio_format) override; | 
| + | 
| // Get current received codec. | 
| int ReceiveCodec(CodecInst* current_codec) const override; | 
| @@ -1063,6 +1066,21 @@ int AudioCodingModuleImpl::RegisterExternalReceiveCodec( | 
| sample_rate_hz, external_decoder, name); | 
| } | 
| +bool AudioCodingModuleImpl::RegisterReceiveCodec( | 
| + int rtp_payload_type, | 
| + const SdpAudioFormat& audio_format) { | 
| + rtc::CritScope lock(&acm_crit_sect_); | 
| + RTC_DCHECK(receiver_initialized_); | 
| + | 
| + if (!acm2::RentACodec::IsPayloadTypeValid(rtp_payload_type)) { | 
| + LOG_F(LS_ERROR) << "Invalid payload-type " << rtp_payload_type | 
| + << " for external decoder."; | 
| 
 
ossu
2016/09/28 14:12:28
Why distinguish "external decoder" here?
 
kwiberg-webrtc
2016/09/29 12:38:34
Because I cribbed this code from RegisterExternalR
 
 | 
| + return false; | 
| + } | 
| + | 
| + return receiver_.AddCodec(rtp_payload_type, audio_format); | 
| +} | 
| + | 
| // Get current received codec. | 
| int AudioCodingModuleImpl::ReceiveCodec(CodecInst* current_codec) const { | 
| rtc::CritScope lock(&acm_crit_sect_); |