提升rtsp协议兼容性 (#4003)

海康解码器播放rtsp流url带了?key=value参数,SETUP时会带着这些参数,导致获取trackid失败
This commit is contained in:
286897655 2024-11-09 19:32:18 +08:00 committed by GitHub
parent ef11c66fb8
commit 8e823b3b74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1136,7 +1136,7 @@ int RtspSession::getTrackIndexByTrackType(TrackType type) {
int RtspSession::getTrackIndexByControlUrl(const string &control_url) { int RtspSession::getTrackIndexByControlUrl(const string &control_url) {
for (size_t i = 0; i < _sdp_track.size(); ++i) { 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; return i;
} }
} }