diff --git a/trunk/research/librtmp/srs_bandwidth_check.c b/trunk/research/librtmp/srs_bandwidth_check.c index 016fea7c0..94a02cd6b 100644 --- a/trunk/research/librtmp/srs_bandwidth_check.c +++ b/trunk/research/librtmp/srs_bandwidth_check.c @@ -69,6 +69,11 @@ int do_check(srs_rtmp_t rtmp) srs_human_trace("Retrieve server version failed, ret=%d", ret); return ret; } + + if ((ret = srs_rtmp_play_stream(rtmp)) != 0) { + srs_human_trace("Play rtmp stream failed. ret=%d", ret); + return ret; + } if ((ret = srs_rtmp_bandwidth_check(rtmp, &start_time, &end_time, &play_kbps, &publish_kbps, diff --git a/trunk/src/libs/srs_librtmp.cpp b/trunk/src/libs/srs_librtmp.cpp index be62279c6..1b5d661c5 100644 --- a/trunk/src/libs/srs_librtmp.cpp +++ b/trunk/src/libs/srs_librtmp.cpp @@ -753,14 +753,14 @@ int srs_rtmp_connect_app(srs_rtmp_t rtmp) string tcUrl; switch(context->schema) { case srs_url_schema_normal: - tcUrl=srs_generate_normal_tc_url(context->ip, context->vhost, context->app, context->port); + tcUrl=srs_generate_normal_tc_url(context->ip, context->vhost, context->app, context->port, context->param); break; case srs_url_schema_via: - tcUrl=srs_generate_via_tc_url(context->ip, context->vhost, context->app, context->port); + tcUrl=srs_generate_via_tc_url(context->ip, context->vhost, context->app, context->port, context->param); break; case srs_url_schema_vis: case srs_url_schema_vis2: - tcUrl=srs_generate_vis_tc_url(context->ip, context->vhost, context->app, context->port); + tcUrl=srs_generate_vis_tc_url(context->ip, context->vhost, context->app, context->port, context->param); break; default: break; diff --git a/trunk/src/protocol/srs_protocol_utility.cpp b/trunk/src/protocol/srs_protocol_utility.cpp index 1a905a078..e7878b054 100644 --- a/trunk/src/protocol/srs_protocol_utility.cpp +++ b/trunk/src/protocol/srs_protocol_utility.cpp @@ -177,19 +177,19 @@ string srs_generate_tc_url(string ip, string vhost, string app, int port, string return tcUrl; } -string srs_generate_normal_tc_url(string ip, string vhost, string app, int port) +string srs_generate_normal_tc_url(string ip, string vhost, string app, int port, string param) { - return "rtmp://" + vhost + ":" + srs_int2str(port) + "/" + app; + return "rtmp://" + vhost + ":" + srs_int2str(port) + "/" + app + (param.empty() ? "" : "?" + param); } -string srs_generate_via_tc_url(string ip, string vhost, string app, int port) +string srs_generate_via_tc_url(string ip, string vhost, string app, int port, string param) { - return "rtmp://" + ip + ":" + srs_int2str(port) + "/" + vhost + "/" + app; + return "rtmp://" + ip + ":" + srs_int2str(port) + "/" + vhost + "/" + app + (param.empty() ? "" : "?" + param); } -string srs_generate_vis_tc_url(string ip, string vhost, string app, int port) +string srs_generate_vis_tc_url(string ip, string vhost, string app, int port, string param) { - return "rtmp://" + ip + ":" + srs_int2str(port) + "/" + app; + return "rtmp://" + ip + ":" + srs_int2str(port) + "/" + app + (param.empty() ? "" : "?" + param); } template diff --git a/trunk/src/protocol/srs_protocol_utility.hpp b/trunk/src/protocol/srs_protocol_utility.hpp index 912da9e64..68816b4e1 100644 --- a/trunk/src/protocol/srs_protocol_utility.hpp +++ b/trunk/src/protocol/srs_protocol_utility.hpp @@ -89,19 +89,19 @@ extern std::string srs_generate_tc_url( * srs_detect_tools generate the normal tcUrl */ extern std::string srs_generate_normal_tc_url( - std::string ip, std::string vhost, std::string app, int port); + std::string ip, std::string vhost, std::string app, int port, std::string param); /** * srs_detect_tools generate the normal tcUrl */ extern std::string srs_generate_via_tc_url( - std::string ip, std::string vhost, std::string app, int port); + std::string ip, std::string vhost, std::string app, int port, std::string param); /** * srs_detect_tools generate the vis/vis2 tcUrl */ extern std::string srs_generate_vis_tc_url( - std::string ip, std::string vhost, std::string app, int port); + std::string ip, std::string vhost, std::string app, int port, std::string param); /** * create shared ptr message from bytes.