From 09dbda5b186a6fd7e99faf05426c4274e975dc85 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 2 Aug 2018 07:24:08 +0800 Subject: [PATCH] For #1031, SRS forwarder support douyu.com. --- trunk/src/app/srs_app_forward.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/trunk/src/app/srs_app_forward.cpp b/trunk/src/app/srs_app_forward.cpp index 7698cb5bce..47fe6e8094 100755 --- a/trunk/src/app/srs_app_forward.cpp +++ b/trunk/src/app/srs_app_forward.cpp @@ -248,9 +248,17 @@ int SrsForwarder::cycle() return ret; } - if ((ret = client->publish(_req->stream, stream_id)) != ERROR_SUCCESS) { - srs_error("connect with server failed, stream_name=%s, stream_id=%d. ret=%d", - _req->stream.c_str(), stream_id, ret); + 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 ((ret = client->publish(stream, stream_id)) != ERROR_SUCCESS) { + srs_error("connect with server failed, stream_name=%s, stream_id=%d. ret=%d", stream.c_str(), stream_id, ret); return ret; }