From 4e50f13d031bcac027bf9f01a3966c8e3295eb5c Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 12 Feb 2015 12:47:00 +0100 Subject: [PATCH] Fixed VLC-specific format RTMP URLs. --- src/output/output_rtmp.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/output/output_rtmp.cpp b/src/output/output_rtmp.cpp index 5f1a6b8e..81bb1b06 100644 --- a/src/output/output_rtmp.cpp +++ b/src/output/output_rtmp.cpp @@ -447,6 +447,18 @@ namespace Mist { if ((amfData.getContentP(0)->StrValue() == "publish")) { if (amfData.getContentP(3)) { streamName = amfData.getContentP(3)->StrValue(); + + + size_t colonPos = streamName.find(':'); + if (colonPos != std::string::npos && colonPos < 6){ + std::string oldName = streamName; + if (std::string(".")+oldName.substr(0, colonPos) == oldName.substr(oldName.size() - colonPos - 1)){ + streamName = oldName.substr(colonPos + 1); + }else{ + streamName = oldName.substr(colonPos + 1) + std::string(".") + oldName.substr(0, colonPos); + } + } + Util::sanitizeName(streamName); //pull the server configuration IPC::sharedPage serverCfg("!mistConfig", DEFAULT_CONF_PAGE_SIZE); ///< Contains server configuration and capabilities @@ -525,7 +537,11 @@ namespace Mist { size_t colonPos = streamName.find(':'); if (colonPos != std::string::npos && colonPos < 6){ std::string oldName = streamName; - streamName = oldName.substr(colonPos + 1) + std::string(".") + oldName.substr(0, colonPos); + if (std::string(".")+oldName.substr(0, colonPos) == oldName.substr(oldName.size() - colonPos - 1)){ + streamName = oldName.substr(colonPos + 1); + }else{ + streamName = oldName.substr(colonPos + 1) + std::string(".") + oldName.substr(0, colonPos); + } } Util::sanitizeName(streamName); initialize();