diff options
Diffstat (limited to 'pc')
-rw-r--r-- | pc/webrtc_sdp.cc | 6 | ||||
-rw-r--r-- | pc/webrtc_sdp_unittest.cc | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/pc/webrtc_sdp.cc b/pc/webrtc_sdp.cc index d49684e209..29a9030483 100644 --- a/pc/webrtc_sdp.cc +++ b/pc/webrtc_sdp.cc @@ -686,10 +686,12 @@ void CreateTracksFromSsrcInfos(const SsrcInfoVec& ssrc_infos, int msid_signaling) { RTC_DCHECK(tracks != NULL); for (const SsrcInfo& ssrc_info : ssrc_infos) { + // According to https://tools.ietf.org/html/rfc5576#section-6.1, the CNAME + // attribute is mandatory, but we relax that restriction. if (ssrc_info.cname.empty()) { - continue; + RTC_LOG(LS_WARNING) << "CNAME attribute missing for SSRC " + << ssrc_info.ssrc_id; } - std::vector<std::string> stream_ids; std::string track_id; if (msid_signaling & cricket::kMsidSignalingMediaSection) { diff --git a/pc/webrtc_sdp_unittest.cc b/pc/webrtc_sdp_unittest.cc index 5bb4ffcd5a..476955d26b 100644 --- a/pc/webrtc_sdp_unittest.cc +++ b/pc/webrtc_sdp_unittest.cc @@ -4672,3 +4672,17 @@ TEST_F(WebRtcSdpTest, DeserializeWithAllSctpProtocols) { EXPECT_TRUE(webrtc::SdpDeserialize(message, &jsep_output, &error)); } } + +// According to https://tools.ietf.org/html/rfc5576#section-6.1, the CNAME +// attribute is mandatory, but we relax that restriction. +TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithoutCname) { + std::string sdp_without_cname = kSdpFullString; + Replace("a=ssrc:1 cname:stream_1_cname\r\n", "", &sdp_without_cname); + JsepSessionDescription new_jdesc(kDummyType); + EXPECT_TRUE(SdpDeserialize(sdp_without_cname, &new_jdesc)); + + audio_desc_->mutable_streams()[0].cname = ""; + ASSERT_TRUE(jdesc_.Initialize(desc_.Clone(), jdesc_.session_id(), + jdesc_.session_version())); + EXPECT_TRUE(CompareSessionDescription(jdesc_, new_jdesc)); +} |