|
|
@ -270,10 +270,7 @@ int SrsRtspConn::do_cycle()
|
|
|
|
if ((pos = rtsp_tcUrl.rfind(".sdp")) != string::npos) {
|
|
|
|
if ((pos = rtsp_tcUrl.rfind(".sdp")) != string::npos) {
|
|
|
|
rtsp_tcUrl = rtsp_tcUrl.substr(0, pos);
|
|
|
|
rtsp_tcUrl = rtsp_tcUrl.substr(0, pos);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((pos = rtsp_tcUrl.rfind("/")) != string::npos) {
|
|
|
|
srs_parse_rtmp_url(rtsp_tcUrl, rtsp_tcUrl, rtsp_stream);
|
|
|
|
rtsp_stream = rtsp_tcUrl.substr(pos + 1);
|
|
|
|
|
|
|
|
rtsp_tcUrl = rtsp_tcUrl.substr(0, pos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
srs_assert(req->sdp);
|
|
|
|
srs_assert(req->sdp);
|
|
|
|
video_id = ::atoi(req->sdp->video_stream_id.c_str());
|
|
|
|
video_id = ::atoi(req->sdp->video_stream_id.c_str());
|
|
|
@ -651,8 +648,6 @@ int SrsRtspConn::connect()
|
|
|
|
|
|
|
|
|
|
|
|
// parse uri
|
|
|
|
// parse uri
|
|
|
|
if (!req) {
|
|
|
|
if (!req) {
|
|
|
|
req = new SrsRequest();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string schema, host, vhost, app, port, param;
|
|
|
|
std::string schema, host, vhost, app, port, param;
|
|
|
|
srs_discovery_tc_url(rtsp_tcUrl, schema, host, vhost, app, port, param);
|
|
|
|
srs_discovery_tc_url(rtsp_tcUrl, schema, host, vhost, app, port, param);
|
|
|
|
|
|
|
|
|
|
|
@ -661,18 +656,9 @@ int SrsRtspConn::connect()
|
|
|
|
output = srs_string_replace(output, "[app]", app);
|
|
|
|
output = srs_string_replace(output, "[app]", app);
|
|
|
|
output = srs_string_replace(output, "[stream]", rtsp_stream);
|
|
|
|
output = srs_string_replace(output, "[stream]", rtsp_stream);
|
|
|
|
|
|
|
|
|
|
|
|
size_t pos = string::npos;
|
|
|
|
req = new SrsRequest();
|
|
|
|
string uri = req->tcUrl = output;
|
|
|
|
srs_parse_rtmp_url(output, req->tcUrl, req->stream);
|
|
|
|
|
|
|
|
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->port, req->param);
|
|
|
|
// tcUrl, stream
|
|
|
|
|
|
|
|
if ((pos = uri.rfind("/")) != string::npos) {
|
|
|
|
|
|
|
|
req->stream = uri.substr(pos + 1);
|
|
|
|
|
|
|
|
req->tcUrl = uri = uri.substr(0, pos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
srs_discovery_tc_url(req->tcUrl,
|
|
|
|
|
|
|
|
req->schema, req->host, req->vhost, req->app, req->port,
|
|
|
|
|
|
|
|
req->param);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// connect host.
|
|
|
|
// connect host.
|
|
|
|