From e4cdc5f213ad2784fb81b8d61d4203013c9e3426 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Thu, 14 Oct 2021 16:22:13 +0800 Subject: [PATCH] =?UTF-8?q?webrtc=20extmap=E6=96=B9=E5=90=91=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E5=A4=B1=E8=B4=A5=E6=97=B6=EF=BC=8C=E4=B8=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=BF=9Bsdp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index 43bfe640..c1e082ea 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1749,8 +1749,14 @@ RETRY: for (auto &ext : offer_media.extmap) { auto it = configure.extmap.find(RtpExt::getExtType(ext.ext)); if (it != configure.extmap.end()) { + auto new_dir = matchDirection(ext.direction, it->second); + switch (new_dir) { + case RtpDirection::invalid: + case RtpDirection::inactive: continue; + default: break; + } answer_media.extmap.emplace_back(ext); - answer_media.extmap.back().direction = matchDirection(ext.direction, it->second); + answer_media.extmap.back().direction = new_dir; } }