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; }