| Index: webrtc/voice_engine/channel.cc
|
| diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
|
| index 100832de3adeb2dc986cd255dc271a109ea6bbb7..f8c0e090a8d56bf40e841414d1b8295a0656f64f 100644
|
| --- a/webrtc/voice_engine/channel.cc
|
| +++ b/webrtc/voice_engine/channel.cc
|
| @@ -1390,6 +1390,11 @@ int32_t Channel::GetVADStatus(bool& enabledVAD,
|
| }
|
|
|
| int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
|
| + return SetRecPayloadType(codec.pltype, CodecInstToSdp(codec));
|
| +}
|
| +
|
| +int32_t Channel::SetRecPayloadType(int payload_type,
|
| + const SdpAudioFormat& format) {
|
| WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
|
| "Channel::SetRecPayloadType()");
|
|
|
| @@ -1400,7 +1405,9 @@ int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
|
| return -1;
|
| }
|
|
|
| - if (codec.pltype == -1) {
|
| + const CodecInst codec = SdpToCodecInst(payload_type, format);
|
| +
|
| + if (payload_type == -1) {
|
| // De-register the selected codec (RTP/RTCP module and ACM)
|
|
|
| int8_t pltype(-1);
|
| @@ -1438,11 +1445,9 @@ int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
|
| return -1;
|
| }
|
| }
|
| - if (!audio_coding_->RegisterReceiveCodec(codec.pltype,
|
| - CodecInstToSdp(codec))) {
|
| - audio_coding_->UnregisterReceiveCodec(codec.pltype);
|
| - if (!audio_coding_->RegisterReceiveCodec(codec.pltype,
|
| - CodecInstToSdp(codec))) {
|
| + if (!audio_coding_->RegisterReceiveCodec(payload_type, format)) {
|
| + audio_coding_->UnregisterReceiveCodec(payload_type);
|
| + if (!audio_coding_->RegisterReceiveCodec(payload_type, format)) {
|
| _engineStatisticsPtr->SetLastError(
|
| VE_AUDIO_CODING_MODULE_ERROR, kTraceError,
|
| "SetRecPayloadType() ACM registration failed - 1");
|
|
|