Commit 1b6e61c4 by xiongziliang

1、修复#125

2、修复非法rtsp url导致异常的问题
parent 36a3f422
Subproject commit 0ac7b3b1dc9817de1b1bb8644e2799ca0e4e9472
Subproject commit 442fb18d2c13de4d5ac005c6d286e3e2b73309eb
......@@ -105,7 +105,7 @@ void RtspPlayer::play(const string &strUrl){
}
void RtspPlayer::play(bool isSSL,const string &strUrl, const string &strUser, const string &strPwd, Rtsp::eRtpType eType ) {
DebugL << strUrl << " "
DebugL << strUrl << " "
<< (strUser.size() ? strUser : "null") << " "
<< (strPwd.size() ? strPwd:"null") << " "
<< eType;
......@@ -122,7 +122,7 @@ void RtspPlayer::play(bool isSSL,const string &strUrl, const string &strUser, co
_eType = eType;
auto ip = FindField(strUrl.data(), "://", "/");
if (!ip.size()) {
if (ip.empty()) {
ip = split(FindField(strUrl.data(), "://", NULL),"?")[0];
}
auto port = atoi(FindField(ip.data(), ":", NULL).data());
......@@ -134,6 +134,11 @@ void RtspPlayer::play(bool isSSL,const string &strUrl, const string &strUser, co
ip = FindField(ip.data(), NULL, ":");
}
if(ip.empty()){
onPlayResult_l(SockException(Err_other,StrPrinter << "illegal rtsp url:" << strUrl));
return;
}
_strUrl = strUrl;
weak_ptr<RtspPlayer> weakSelf = dynamic_pointer_cast<RtspPlayer>(shared_from_this());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论