1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Squash: Fix bugs. v5.0.20

This commit is contained in:
winlin 2022-01-11 08:40:05 +08:00
parent d2fe83b032
commit 4110fb14cb
36 changed files with 433 additions and 98 deletions

View file

@ -260,7 +260,7 @@ rtmp_client::rtmp_client(std::string key_path):_key_path(key_path)
_streamname = ret_vec[1];
}
std::stringstream url_ss;
std::vector<std::string> ip_ports = _srs_config->get_listens();
int port = 0;
std::string ip;
@ -271,24 +271,19 @@ rtmp_client::rtmp_client(std::string key_path):_key_path(key_path)
break;
}
}
port = (port == 0) ? 1935 : port;
if (_vhost == DEF_VHOST) {
url_ss << "rtmp://127.0.0.1:" << port
<< "/" << _appname
<< "/" << _streamname;
} else {
if (_appname.find("?") == std::string::npos) {
url_ss << "rtmp://127.0.0.1:" << port
<< "/" << _appname << "?vhost=" << _vhost
<< "/" << _streamname;
} else {
url_ss << "rtmp://127.0.0.1:" << port
<< "/" << _appname << "&vhost=" << _vhost
<< "/" << _streamname;
}
}
_url = url_ss.str();
port = (port == 0) ? SRS_CONSTS_RTMP_DEFAULT_PORT : port;
std::stringstream ss;
ss << "rtmp://" << SRS_CONSTS_LOCALHOST;
ss << ":" << port;
ss << "/" << _appname;
if (_vhost != DEF_VHOST) {
ss << "?vhost=" << _vhost;
}
ss << "/" << _streamname;
_url = ss.str();
_h264_sps_changed = false;
_h264_pps_changed = false;