From 56ccd4332a546c5e95e25db08d68c3387e50b726 Mon Sep 17 00:00:00 2001 From: monktan89 Date: Wed, 14 Dec 2022 15:08:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E9=AB=98rtsp=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=99=A8=E5=85=BC=E5=AE=B9=E6=80=A7:=20#2159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/Rtsp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index a2db7796..251b7f65 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -166,9 +166,10 @@ void SdpParser::load(const string &sdp) { break; case 'm': { track = std::make_shared(); - int pt, port; + int pt, port, port_count; char rtp[16] = {0}, type[16]; - if (4 == sscanf(opt_val.data(), " %15[^ ] %d %15[^ ] %d", type, &port, rtp, &pt)) { + if (4 == sscanf(opt_val.data(), " %15[^ ] %d %15[^ ] %d", type, &port, rtp, &pt) || + 5 == sscanf(opt_val.data(), " %15[^ ] %d/%d %15[^ ] %d", type, &port, &port_count, rtp, &pt)) { track->_pt = pt; track->_samplerate = RtpPayload::getClockRate(pt); track->_channel = RtpPayload::getAudioChannel(pt);