mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
1、修复#125
2、修复非法rtsp url导致异常的问题
This commit is contained in:
Submodule 3rdpart/ZLToolKit updated: 0ac7b3b1dc...442fb18d2c
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user