From 989b4abcf32d4a1605e7af160a1a07916c6b324e Mon Sep 17 00:00:00 2001 From: kwiberg Date: Wed, 25 Nov 2015 01:19:13 -0800 Subject: [PATCH] Move the stereo-disables-CNG logic from CodecManager to Rent-A-Codec BUG=webrtc:5028 Review URL: https://codereview.webrtc.org/1473563004 Cr-Commit-Position: refs/heads/master@{#10784} --- .../modules/audio_coding/main/acm2/codec_manager.cc | 11 ----------- webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc | 3 ++- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/webrtc/modules/audio_coding/main/acm2/codec_manager.cc b/webrtc/modules/audio_coding/main/acm2/codec_manager.cc index 80229353cf..7db6919b2e 100644 --- a/webrtc/modules/audio_coding/main/acm2/codec_manager.cc +++ b/webrtc/modules/audio_coding/main/acm2/codec_manager.cc @@ -149,15 +149,6 @@ int CodecManager::RegisterEncoder(const CodecInst& send_codec) { break; } - // Set Stereo, and make sure VAD and DTX is turned off. - if (send_codec.channels != 1) { - if (codec_stack_params_.use_cng) { - WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceAudioCoding, dummy_id, - "VAD/DTX is turned off, not supported when sending stereo."); - } - codec_stack_params_.use_cng = false; - } - // Check if the codec is already registered as send codec. bool new_codec = true; if (CurrentEncoder()) { @@ -231,8 +222,6 @@ void CodecManager::RegisterEncoder(AudioEncoder* external_speech_encoder) { static const char kName[] = "external"; memcpy(send_codec_inst_.plname, kName, sizeof(kName)); - if (send_codec_inst_.channels != 1) - codec_stack_params_.use_cng = false; if (codec_stack_params_.use_codec_fec) { // Switch FEC on. On failure, remember that FEC is off. if (!external_speech_encoder->SetFec(true)) diff --git a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc index 328181428b..b31092cb11 100644 --- a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc +++ b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc @@ -259,7 +259,8 @@ AudioEncoder* RentACodec::RentEncoderStack(AudioEncoder* speech_encoder, : rtc::Optional(it->second); }; auto cng_pt = pt(param->cng_payload_types); - param->use_cng = param->use_cng && cng_pt; + param->use_cng = + param->use_cng && cng_pt && speech_encoder->NumChannels() == 1; auto red_pt = pt(param->red_payload_types); param->use_red = param->use_red && red_pt;