diff --git a/README.md b/README.md index a791194ddf..2af9b3438a 100755 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ Please select according to languages: ### V3 changes +* v3.0, 2018-08-02, For [#1031][bug #1031], SRS edge support douyu.com. 3.0.34 * v3.0, 2018-07-22, Replace hex to string to match MIT license. 3.0.33 * v3.0, 2018-07-22, Replace base64 to match MIT license. 3.0.32 * v3.0, 2018-07-22, Replace crc32 IEEE and MPEG by pycrc to match MIT license. 3.0.31 @@ -224,6 +225,7 @@ Please select according to languages: ### V2 changes +* v2.0, 2018-08-02, For [#1031][bug #1031], SRS edge support douyu.com. 2.0.250 * v2.0, 2018-07-21, Merge [#1119][bug #1119], fix memory leak. 2.0.249 * v2.0, 2018-07-18, [2.0 release3(2.0.248)][r2.0r3] released. 86775 lines. * v2.0, 2018-07-17, Merge [#1176][bug #1176], fix scaned issues. 2.0.248 @@ -1430,6 +1432,7 @@ Winlin [bug #1077]: https://github.com/ossrs/srs/issues/1077 [bug #1176]: https://github.com/ossrs/srs/issues/1176 [bug #1119]: https://github.com/ossrs/srs/issues/1119 +[bug #1031]: https://github.com/ossrs/srs/issues/1031 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx [bug #735]: https://github.com/ossrs/srs/issues/735 diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp index 7b378ea999..490472fc33 100644 --- a/trunk/src/app/srs_app_edge.cpp +++ b/trunk/src/app/srs_app_edge.cpp @@ -472,6 +472,14 @@ srs_error_t SrsEdgeForwarder::start() url = srs_generate_rtmp_url(server, port, vhost, req->app, req->stream); } + // Pass params in stream, @see https://github.com/ossrs/srs/issues/1031#issuecomment-409745733 + if (!req->param.empty()) { + if (req->param.find("?") != 0) { + url += "?"; + } + url += req->param; + } + // open socket. srs_freep(sdk); int64_t cto = SRS_EDGE_FORWARDER_TMMS; @@ -492,6 +500,7 @@ srs_error_t SrsEdgeForwarder::start() if ((err = trd->start()) != srs_success) { return srs_error_wrap(err, "coroutine"); } + srs_trace("edge-fwr publish url %s", url.c_str()); return err; } diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 8e76a8d707..8104f69078 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -27,7 +27,7 @@ // current release version #define VERSION_MAJOR 3 #define VERSION_MINOR 0 -#define VERSION_REVISION 33 +#define VERSION_REVISION 34 // generated by configure, only macros. #include diff --git a/trunk/src/service/srs_service_rtmp_conn.cpp b/trunk/src/service/srs_service_rtmp_conn.cpp index fa5e103c4b..d22c2ca1fa 100644 --- a/trunk/src/service/srs_service_rtmp_conn.cpp +++ b/trunk/src/service/srs_service_rtmp_conn.cpp @@ -154,9 +154,19 @@ srs_error_t SrsBasicRtmpClient::publish() { srs_error_t err = srs_success; + string stream = req->stream; + + // Pass params in stream, @see https://github.com/ossrs/srs/issues/1031#issuecomment-409745733 + if (!req->param.empty()) { + if (req->param.find("?") != 0) { + stream += "?"; + } + stream += req->param; + } + // publish. - if ((err = client->publish(req->stream, stream_id)) != srs_success) { - return srs_error_wrap(err, "publish failed, stream=%s, stream_id=%d", req->stream.c_str(), stream_id); + if ((err = client->publish(stream, stream_id)) != srs_success) { + return srs_error_wrap(err, "publish failed, stream=%s, stream_id=%d", stream.c_str(), stream_id); } return err; @@ -166,8 +176,18 @@ srs_error_t SrsBasicRtmpClient::play() { srs_error_t err = srs_success; - if ((err = client->play(req->stream, stream_id)) != srs_success) { - return srs_error_wrap(err, "connect with server failed, stream=%s, stream_id=%d", req->stream.c_str(), stream_id); + string stream = req->stream; + + // Pass params in stream, @see https://github.com/ossrs/srs/issues/1031#issuecomment-409745733 + if (!req->param.empty()) { + if (req->param.find("?") != 0) { + stream += "?"; + } + stream += req->param; + } + + if ((err = client->play(stream, stream_id)) != srs_success) { + return srs_error_wrap(err, "connect with server failed, stream=%s, stream_id=%d", stream.c_str(), stream_id); } return err;