From 066e3217ea20efa36c0d693e11d3feefa7d9b5cb Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 18 Jan 2019 11:27:51 +0800 Subject: [PATCH] =?UTF-8?q?rtsp=E6=92=AD=E6=94=BE=E5=99=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81302=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/RtspPlayer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Rtsp/RtspPlayer.cpp b/src/Rtsp/RtspPlayer.cpp index 99b1e164..d1b22946 100644 --- a/src/Rtsp/RtspPlayer.cpp +++ b/src/Rtsp/RtspPlayer.cpp @@ -201,6 +201,14 @@ void RtspPlayer::handleResDESCRIBE(const Parser& parser) { sendDescribe(); return; } + if(parser.Url() == "302"){ + auto newUrl = parser["Location"]; + if(newUrl.empty()){ + throw std::runtime_error("未找到Location字段(跳转url)"); + } + play(newUrl.data()); + return; + } if (parser.Url() != "200") { throw std::runtime_error( StrPrinter << "DESCRIBE:" << parser.Url() << " " << parser.Tail() << endl);