Allowing resetting of AudioNetworkAdaptor in AudioSendStream.

BUG=webrtc:6681

Review-Url: https://codereview.webrtc.org/2495833002
Cr-Commit-Position: refs/heads/master@{#15058}
This commit is contained in:
minyue 2016-11-14 00:51:50 -08:00 committed by Commit bot
parent 218f436713
commit 6f0b9fda53
2 changed files with 7 additions and 2 deletions

View File

@ -292,6 +292,12 @@ bool AudioSendStream::SetupSendCodec() {
codec->SetVADStatus(channel, false);
codec->SetFECStatus(channel, false);
// We disable audio network adaptor here. This will on one hand make sure that
// audio network adaptor is disabled by default, and on the other allow audio
// network adaptor to be reconfigured, since SetReceiverFrameLengthRange can
// be only called when audio network adaptor is disabled.
channel_proxy_->DisableAudioNetworkAdaptor();
const auto& send_codec_spec = config_.send_codec_spec;
// We set the codec first, since the below extra configuration is only applied
@ -345,8 +351,6 @@ bool AudioSendStream::SetupSendCodec() {
*config_.audio_network_adaptor_config);
LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
<< config_.rtp.ssrc;
} else {
channel_proxy_->DisableAudioNetworkAdaptor();
}
}

View File

@ -142,6 +142,7 @@ struct ConfigHelper {
.WillOnce(Return(0));
EXPECT_CALL(voice_engine_, SetFECStatus(kChannelId, false))
.WillOnce(Return(0));
EXPECT_CALL(*channel_proxy_, DisableAudioNetworkAdaptor());
// Let |GetSendCodec| return -1 for the first time to indicate that no send
// codec has been set.
EXPECT_CALL(voice_engine_, GetSendCodec(kChannelId, _))