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

SRT: use const string to sprint rtmp url. (#2847)

This commit is contained in:
liuxiaoliang 2022-01-06 12:02:31 +08:00 committed by GitHub
parent 51ca3fd80a
commit 4434bb1a25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -268,10 +268,10 @@ rtmp_client::rtmp_client(std::string key_path):_key_path(key_path)
break; break;
} }
} }
port = (port == 0) ? 1935 : port; port = (port == 0) ? SRS_CONSTS_RTMP_DEFAULT_PORT : port;
std::stringstream ss; std::stringstream ss;
ss << "rtmp://127.0.0.1"; ss << "rtmp://" << SRS_CONSTS_LOCALHOST;
ss << ":" << port; ss << ":" << port;
ss << "/" << _appname; ss << "/" << _appname;
if (_vhost != DEF_VHOST) { if (_vhost != DEF_VHOST) {