mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
parent
c7ea21d06a
commit
f1a448bc6a
1 changed files with 13 additions and 11 deletions
|
@ -15,6 +15,7 @@
|
||||||
#include <srs_app_config.hpp>
|
#include <srs_app_config.hpp>
|
||||||
#include <srs_kernel_stream.hpp>
|
#include <srs_kernel_stream.hpp>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
std::shared_ptr<srt2rtmp> srt2rtmp::s_srt2rtmp_ptr;
|
std::shared_ptr<srt2rtmp> srt2rtmp::s_srt2rtmp_ptr;
|
||||||
|
|
||||||
|
@ -258,7 +259,6 @@ rtmp_client::rtmp_client(std::string key_path):_key_path(key_path)
|
||||||
_appname = ret_vec[0];
|
_appname = ret_vec[0];
|
||||||
_streamname = ret_vec[1];
|
_streamname = ret_vec[1];
|
||||||
}
|
}
|
||||||
char url_sz[128];
|
|
||||||
|
|
||||||
std::vector<std::string> ip_ports = _srs_config->get_listens();
|
std::vector<std::string> ip_ports = _srs_config->get_listens();
|
||||||
int port = 0;
|
int port = 0;
|
||||||
|
@ -271,22 +271,24 @@ rtmp_client::rtmp_client(std::string key_path):_key_path(key_path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
port = (port == 0) ? 1935 : port;
|
port = (port == 0) ? 1935 : port;
|
||||||
if (_vhost == DEF_VHOST) {
|
|
||||||
sprintf(url_sz, "rtmp://127.0.0.1:%d/%s/%s", port,
|
|
||||||
_appname.c_str(), _streamname.c_str());
|
|
||||||
} else {
|
|
||||||
sprintf(url_sz, "rtmp://127.0.0.1:%d/%s?vhost=%s/%s", port,
|
|
||||||
_appname.c_str(), _vhost.c_str(), _streamname.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
_url = url_sz;
|
std::stringstream ss;
|
||||||
|
ss << "rtmp://127.0.0.1";
|
||||||
|
ss << ":" << port;
|
||||||
|
ss << "/" << _appname;
|
||||||
|
if (_vhost != DEF_VHOST) {
|
||||||
|
ss << "?vhost=" << _vhost;
|
||||||
|
}
|
||||||
|
ss << "/" << _streamname;
|
||||||
|
|
||||||
|
_url = ss.str();
|
||||||
|
|
||||||
_h264_sps_changed = false;
|
_h264_sps_changed = false;
|
||||||
_h264_pps_changed = false;
|
_h264_pps_changed = false;
|
||||||
_h264_sps_pps_sent = false;
|
_h264_sps_pps_sent = false;
|
||||||
|
|
||||||
_last_live_ts = now_ms();
|
_last_live_ts = now_ms();
|
||||||
srs_trace("rtmp client construct url:%s", url_sz);
|
srs_trace("rtmp client construct url:%s", _url.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
rtmp_client::~rtmp_client() {
|
rtmp_client::~rtmp_client() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue