From 8531b5e1cb0e1692efe6e8e026fe2c9990ce3f8d Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Fri, 15 Oct 2021 16:15:23 +0800 Subject: [PATCH] =?UTF-8?q?webrtc=20codec=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E4=B8=BA?= =?UTF-8?q?inactive=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index c1e082ea..115629bf 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1707,7 +1707,9 @@ RETRY: default: continue; } - answer_media.direction = matchDirection(offer_media.direction, configure.direction); + //如果codec匹配失败,那么禁用该track + answer_media.direction = check_codec ? matchDirection(offer_media.direction, configure.direction) + : RtpDirection::inactive; if (answer_media.direction == RtpDirection::invalid) { continue; }