From 8e823b3b74f6f1107721afdf28f0d2f56075bc8a Mon Sep 17 00:00:00 2001 From: 286897655 <286897655@qq.com> Date: Sat, 9 Nov 2024 19:32:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87rtsp=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=20(#4003)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 海康解码器播放rtsp流url带了?key=value参数,SETUP时会带着这些参数,导致获取trackid失败 --- src/Rtsp/RtspSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index ef02ff59..6fa88b7e 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -1136,7 +1136,7 @@ int RtspSession::getTrackIndexByTrackType(TrackType type) { int RtspSession::getTrackIndexByControlUrl(const string &control_url) { for (size_t i = 0; i < _sdp_track.size(); ++i) { - if (control_url == _sdp_track[i]->getControlUrl(_content_base)) { + if (control_url.find(_sdp_track[i]->getControlUrl(_content_base)) == 0) { return i; } }