兼容一些rtsp流 #735

This commit is contained in:
xia-chu
2021-02-21 21:27:26 +08:00
parent 19f3b1bd6f
commit a19f67679a
6 changed files with 25 additions and 29 deletions

View File

@@ -86,6 +86,14 @@ string SdpTrack::getName() const{
}
}
string SdpTrack::getControlUrl(const string &base_url) const{
if (_control.find("://") != string::npos) {
//以rtsp://开头
return _control;
}
return base_url +"/" + _control;
}
string SdpTrack::toString() const {
_StrPrinter _printer;
switch (_type){
@@ -246,8 +254,6 @@ void SdpParser::load(const string &sdp) {
it = track._attr.find("control");
if(it != track._attr.end()) {
track._control = it->second;
auto surffix = string("/") + track._control;
track._control_surffix = surffix.substr(1 + surffix.rfind('/'));
}
}
}