From 7b2bd221eac4086358d081f4f0bfeb2a95b050f2 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Tue, 25 Nov 2025 10:41:39 +0800 Subject: [PATCH] Revert "fix: handle BUNDLE filed compatibility (#4488)" This reverts commit 0b57a573c66ff050eb0309dde10fb616fae823bd. --- webrtc/Sdp.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index 67787b82..a6412e0b 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1082,9 +1082,7 @@ RtcSessionSdp::Ptr RtcSession::toRtcSessionSdp() const { if (connection.empty()) { sdp.addItem(std::make_shared(connection)); } - if (media.size() > 1) { - sdp.addAttr(std::make_shared(group)); - } + sdp.addAttr(std::make_shared(group)); sdp.addAttr(std::make_shared()); sdp.addAttr(std::make_shared(msid_semantic)); @@ -1356,7 +1354,7 @@ void RtcSession::checkValid() const { CHECK(!session_name.empty()); CHECK(!msid_semantic.empty()); CHECK(!media.empty()); - CHECK(media.size() == 1 || (!group.mids.empty() && group.mids.size() <= media.size()), "只支持group BUNDLE模式"); + CHECK(!group.mids.empty() && group.mids.size() <= media.size(), "只支持group BUNDLE模式"); bool have_active_media = false; for (auto &item : media) { @@ -1590,12 +1588,10 @@ shared_ptr RtcConfigure::createOffer() const { createMediaOffer(ret); // 设置音视频端口复用 [AUTO-TRANSLATED:ffe27d17] // Set audio and video port multiplexing - if (ret->media.size() > 1) { - for (auto &m : ret->media) { - // 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); - } + for (auto &m : ret->media) { + // 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); } }