From f9381a6fef810cfb94bec2cc27c45dd9cc63f3f0 Mon Sep 17 00:00:00 2001 From: Dw9 Date: Fri, 25 Aug 2023 18:22:31 +0800 Subject: [PATCH] =?UTF-8?q?rtc=E4=B8=8D=E6=94=AF=E6=8C=81=E7=9A=84track,?= =?UTF-8?q?=E4=B8=8D=E8=AE=BE=E7=BD=AEgroup=20attribute?= 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 ca33af88..bbb8d980 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1555,7 +1555,10 @@ shared_ptr RtcConfigure::createAnswer(const RtcSession &offer) const //设置音视频端口复用 if (!offer.group.mids.empty()) { for (auto &m : ret->media) { - ret->group.mids.emplace_back(m.mid); + //The remote end has rejected (port 0) the m-section, so it should not be putting its mid in the group attribute. + if(m.port) { + ret->group.mids.emplace_back(m.mid); + } } } return ret;