mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #1031, SRS edge support douyu.com. 3.0.34
This commit is contained in:
commit
a66d450ec1
4 changed files with 37 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue