From d2f02c0a0c9a662752beedd614ca8cab957af8df Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 28 Aug 2021 13:02:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drtsp=20sdp=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/Rtsp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index 8f313323..e1d1507a 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -235,7 +235,7 @@ void SdpParser::load(const string &sdp) { } } - for (it = track._attr.find("rtpmap"); it != track._attr.end();) { + for (it = track._attr.find("rtpmap"); it != track._attr.end() && it->first == "rtpmap";) { auto &rtpmap = it->second; int pt, samplerate, channel; char codec[16] = {0}; @@ -262,7 +262,7 @@ void SdpParser::load(const string &sdp) { ++it; } - for (it = track._attr.find("fmtp"); it != track._attr.end(); ) { + for (it = track._attr.find("fmtp"); it != track._attr.end() && it->first == "fmtp"; ) { auto &fmtp = it->second; int pt; sscanf(fmtp.data(), "%d", &pt);