From 9c552128a7e7c95bf4bcb25418193dcd1736eed3 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Tue, 6 Apr 2021 18:29:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsdp=E4=B8=AD=E6=B2=A1ssrc?= =?UTF-8?q?=E6=97=B6=E8=A7=A6=E5=8F=91=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index b25eabb4..8951e0ee 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -841,7 +841,9 @@ void RtcSession::loadFrom(const string &str, bool check) { if (rtc_ssrc_map.size() > 1) { throw std::invalid_argument("sdp中不存在a=ssrc-group:FID字段,但是ssrc却有多个"); } - ssrc_rtp = rtc_ssrc_map.begin()->second.ssrc; + if (rtc_ssrc_map.size() == 1) { + ssrc_rtp = rtc_ssrc_map.begin()->second.ssrc; + } } for (auto &pr : rtc_ssrc_map) { auto &rtc_ssrc = pr.second; @@ -982,6 +984,7 @@ string RtcSession::toRtspSdp() const{ } } + copy.session_name = "zlmediakit rtsp stream from webrtc"; auto sdp = copy.toRtcSessionSdp(); toRtsp(sdp->items); int i = 0;