| Index: webrtc/voice_engine/channel.cc
|
| diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
|
| index dc93dc7e06c30483a10ee658d78da4d9ca2e3c89..bc8b3f94a8ae5e965e65fbebe0125ff719be7deb 100644
|
| --- a/webrtc/voice_engine/channel.cc
|
| +++ b/webrtc/voice_engine/channel.cc
|
| @@ -1389,6 +1389,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()");
|
|
|
| @@ -1399,7 +1404,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);
|
| @@ -1437,11 +1444,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");
|
|
|