diff options
author | Taylor Brandstetter <deadbeef@webrtc.org> | 2020-02-18 14:05:07 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-18 23:09:05 +0000 |
commit | 4256df09bf26f594f601a1f0a281627a92f2c8be (patch) | |
tree | 00ccbaac7dc3909aac82c415c12a3325a2762a9d /pc | |
parent | 567f03f7a058a1b351af38d1597f5950583802b5 (diff) | |
download | webrtc-4256df09bf26f594f601a1f0a281627a92f2c8be.tar.gz |
Make CNAME optional.
Before this change, lack of a CNAME results in losing all SSRC
information. This isn't necessary; we don't even use the CNAME for
anything on the receiving side.
Note that lack of a CNAME is technically a violation of
https://tools.ietf.org/html/rfc5576#section-6.1.
Bug: webrtc:10385
Change-Id: If9836b6c518367b29ffa1fb00752e52d51915d37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168581
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30552}
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)); +} |