From 598b3840783faae343209ca63d40fcc7015fafe5 Mon Sep 17 00:00:00 2001 From: Balder Date: Mon, 1 Nov 2021 14:56:59 +0100 Subject: [PATCH] Edits for fixing stream names with .m3u in the name. --- src/output/output_hls.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index 44d3ec9c..f019094d 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -283,7 +283,7 @@ namespace Mist{ initialize(); if (!keepGoing()){return;} - if (H.url.find(".m3u") == std::string::npos){ + if (HTTP::URL(H.url).getExt().substr(0, 3) != "m3u"){ std::string tmpStr = H.getUrl().substr(5 + streamName.size()); uint64_t from; if (sscanf(tmpStr.c_str(), "/%zu_%zu/%" PRIu64 "_%" PRIu64 ".ts", &vidTrack, &audTrack, &from, &until) != 4){ @@ -402,7 +402,7 @@ namespace Mist{ void OutHLS::sendTS(const char *tsData, size_t len){H.Chunkify(tsData, len, myConn);} void OutHLS::onFail(const std::string &msg, bool critical){ - if (H.url.find(".m3u") == std::string::npos){ + if (HTTP::URL(H.url).getExt().substr(0, 3) != "m3u"){ HTTPOutput::onFail(msg, critical); return; }