rtsp播放器支持302跳转

This commit is contained in:
xiongziliang 2019-01-18 11:27:51 +08:00
parent 4ab1d4ca44
commit 066e3217ea

View File

@ -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);