From b8277974aa83134ae92061822755c1fae56178ee Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 12 Mar 2022 19:26:08 +0800 Subject: [PATCH] =?UTF-8?q?webrtc=20sdp=20msid=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B8=8D=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 4 +--- webrtc/WebRtcEchoTest.cpp | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index e7e5cdb0..c517d4e2 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1149,10 +1149,8 @@ RtcSessionSdp::Ptr RtcSession::toRtcSessionSdp() const{ auto msid = std::make_shared(); if (!m.rtp_rtx_ssrc[0].msid.empty()) { msid->parse(m.rtp_rtx_ssrc[0].msid); - } else { - msid->parse("mslabel label"); + sdp_media.items.emplace_back(wrapSdpAttr(std::move(msid))); } - sdp_media.items.emplace_back(wrapSdpAttr(std::move(msid))); } } diff --git a/webrtc/WebRtcEchoTest.cpp b/webrtc/WebRtcEchoTest.cpp index d2ad8e92..879c6ce7 100644 --- a/webrtc/WebRtcEchoTest.cpp +++ b/webrtc/WebRtcEchoTest.cpp @@ -40,7 +40,9 @@ void WebRtcEchoTest::onCheckSdp(SdpType type, RtcSession &sdp) { if (type == SdpType::answer) { for (auto &m : sdp.media) { for (auto &ssrc : m.rtp_rtx_ssrc) { - ssrc.msid = "zlmediakit msid"; + if (!ssrc.msid.empty()) { + ssrc.msid = "zlmediakit msid"; + } } } }