From 107ca2cbb8c124d15f7941366e2fffb0658b7343 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 7 Mar 2022 15:52:46 +0800 Subject: [PATCH] SRT: Append vhost to stream, not app. v4.0.246 --- trunk/doc/CHANGELOG.md | 1 + trunk/src/core/srs_core_version4.hpp | 2 +- trunk/src/srt/srt_to_rtmp.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index e5073aa0f..ae578700d 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2022-03-07, SRT: Append vhost to stream, not app. v4.0.246 * v4.0, 2022-02-15, Fix warnings for uuid. v4.0.245 * v4.0, 2022-02-15, Merge [#2917](https://github.com/ossrs/srs/pull/2917): SRT: Close connection if RTMP failed. (#2917). v4.0.244 * v4.0, 2022-02-15, Refine build script for SRT to avoid warnings. v4.0.243 diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index f74cfb24b..9ddb20103 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 245 +#define VERSION_REVISION 246 #endif diff --git a/trunk/src/srt/srt_to_rtmp.cpp b/trunk/src/srt/srt_to_rtmp.cpp index ea3922417..c904a6fe1 100644 --- a/trunk/src/srt/srt_to_rtmp.cpp +++ b/trunk/src/srt/srt_to_rtmp.cpp @@ -279,10 +279,11 @@ rtmp_client::rtmp_client(std::string key_path):_key_path(key_path) ss << "rtmp://" << SRS_CONSTS_LOCALHOST; ss << ":" << port; ss << "/" << _appname; - if (_vhost != DEF_VHOST) { - ss << "?vhost=" << _vhost; - } ss << "/" << _streamname; + ss << (_streamname.find("?") != std::string::npos ? "&" : "?") << "upstream=srt"; + if (_vhost != DEF_VHOST) { + ss << "&vhost=" << _vhost; + } _url = ss.str();