mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-26 03:42:21 +08:00
提升rtsp的兼容性
This commit is contained in:
@@ -823,21 +823,15 @@ void RtspPlayer::onPlayResult_l(const SockException &ex , bool handshakeComplete
|
||||
}
|
||||
}
|
||||
|
||||
int RtspPlayer::getTrackIndexByControlSuffix(const string &controlSuffix) const{
|
||||
for (unsigned int i = 0; i < _aTrackInfo.size(); i++) {
|
||||
auto pos = _aTrackInfo[i]->_control_surffix.find(controlSuffix);
|
||||
if (pos == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
int RtspPlayer::getTrackIndexByInterleaved(int interleaved) const{
|
||||
for (unsigned int i = 0; i < _aTrackInfo.size(); i++) {
|
||||
if (_aTrackInfo[i]->_interleaved == interleaved) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
if(_aTrackInfo.size() == 1){
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -847,6 +841,9 @@ int RtspPlayer::getTrackIndexByTrackType(TrackType trackType) const {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
if(_aTrackInfo.size() == 1){
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user