Skip to content

Commit

Permalink
For #1031, SRS edge support douyu.com. 3.0.34
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Aug 1, 2018
2 parents 41c6e83 + 586899a commit a66d450
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
* <strong>v2.0, 2018-07-18, [2.0 release3(2.0.248)][r2.0r3] released. 86775 lines.</strong>
* v2.0, 2018-07-17, Merge [#1176][bug #1176], fix scaned issues. 2.0.248
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions trunk/src/app/srs_app_edge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <srs_auto_headers.hpp>
Expand Down
28 changes: 24 additions & 4 deletions trunk/src/service/srs_service_rtmp_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit a66d450

Please sign in to comment.