From e8f8b48d3828e1eba3de5ef7983568f379723903 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Tue, 25 Jul 2023 15:47:28 +0800 Subject: [PATCH] fix rtsp player pull hik record stream (#2624 #2701) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复rtsp 拉流 sdp中全局a:control:获取失败的bug --- src/Rtsp/Rtsp.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index b2d2b86b..f4963531 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -166,13 +166,13 @@ void SdpParser::load(const string &sdp) { string opt_val = line.substr(2); switch (opt) { case 't': - if (_track_vec.empty()) + if (_track_vec.size() == 1) global_infos.emplace(opt, opt_val); else track->_t = opt_val; break; case 'b': - if (_track_vec.empty()) + if (_track_vec.size() == 1) global_infos.emplace(opt, opt_val); else track->_b = opt_val; @@ -195,12 +195,12 @@ void SdpParser::load(const string &sdp) { case 'a': { string attr = findSubString(opt_val.data(), nullptr, ":"); if (attr.empty()) { - if (_track_vec.empty()) + if (_track_vec.size() == 1) global_infos.emplace(opt, opt_val); else track->_attr.emplace(opt_val, ""); } else { - if (_track_vec.empty()) + if (_track_vec.size() == 1) global_infos.emplace(opt, opt_val); else track->_attr.emplace(attr, findSubString(opt_val.data(), ":", nullptr)); @@ -208,7 +208,7 @@ void SdpParser::load(const string &sdp) { break; } default: { - if (_track_vec.empty()) { + if (_track_vec.size() == 1) { global_infos.emplace(opt, opt_val); } else { track->_other[opt] = opt_val;