Prevent null-stream reconfigs on RTP extensions.

If a codec fails to set (e.g. there's no codec configured), this
prevents a stream reconfigure with an invalid config. Reconfiguring a
stream without correct codec settings causes a CHECK failure.

BUG=chromium:475116
R=stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9007}
This commit is contained in:
Peter Boström 2015-04-15 16:27:49 +02:00
parent 36fc1bad38
commit 3c3f646064

View File

@ -733,7 +733,7 @@ bool WebRtcVideoChannel2::SetSendCodecs(const std::vector<VideoCodec>& codecs) {
FilterSupportedCodecs(MapCodecs(codecs));
if (supported_codecs.empty()) {
LOG(LS_ERROR) << "No video codecs supported by encoder factory.";
LOG(LS_ERROR) << "No video codecs supported.";
return false;
}
@ -1741,7 +1741,8 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetRtpExtensions(
const std::vector<webrtc::RtpExtension>& rtp_extensions) {
rtc::CritScope cs(&lock_);
parameters_.config.rtp.extensions = rtp_extensions;
RecreateWebRtcStream();
if (stream_ != nullptr)
RecreateWebRtcStream();
}
webrtc::VideoEncoderConfig
@ -2096,7 +2097,8 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetRecvCodecs(
void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetRtpExtensions(
const std::vector<webrtc::RtpExtension>& extensions) {
config_.rtp.extensions = extensions;
RecreateWebRtcStream();
if (stream_ != nullptr)
RecreateWebRtcStream();
}
void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() {