Change call order.

Review URL: https://webrtc-codereview.appspot.com/451011

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1887 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pwestin@webrtc.org 2012-03-14 13:24:53 +00:00
parent 75047dc88e
commit 2058fee396

View File

@ -304,14 +304,9 @@ bool ViEChannelManager::CreateChannelObject(int channel_id,
delete vie_channel;
return false;
}
VideoCodec encoder;
vie_encoder->GetEncoder(encoder);
if (vie_channel->SetSendCodec(encoder) != 0) {
vie_encoder = NULL;
}
// Register the channel at the encoder.
// Need to call RegisterSendRtpRtcpModule before SetSendCodec since
// the SetSendCodec call use the default rtp/rtcp module.
RtpRtcp* send_rtp_rtcp_module = vie_encoder->SendRtpRtcpModule();
if (vie_channel->RegisterSendRtpRtcpModule(*send_rtp_rtcp_module) != 0) {
delete vie_channel;
@ -320,6 +315,12 @@ bool ViEChannelManager::CreateChannelObject(int channel_id,
return false;
}
VideoCodec encoder;
vie_encoder->GetEncoder(encoder);
if (vie_channel->SetSendCodec(encoder) != 0) {
vie_encoder = NULL;
}
// Store the channel, add it to the channel group and save the vie_encoder.
channel_map_[channel_id] = vie_channel;
vie_encoder_map_[channel_id] = vie_encoder;