From 3b16f0367408d24cb72ef508cb0fbe6e82fe33a4 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 17 May 2018 22:50:49 +0200 Subject: [PATCH] Added HLS protocol option to disable session IDs, merging together all views from a single user into a single session. --- src/output/output_hls.cpp | 11 ++++++++++- src/output/output_hls.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index 4ed360a0..f3fe3363 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -97,7 +97,11 @@ namespace Mist { if (audioId != -1) { result << "_" << audioId; } - result << "/index.m3u8?sessId=" << getpid() << "\r\n"; + if (hasSessionIDs()){ + result << "/index.m3u8?sessId=" << getpid() << "\r\n"; + }else{ + result << "/index.m3u8\r\n"; + } }else if(it->second.codec == "subtitle"){ if(it->second.lang.empty()){ @@ -373,6 +377,11 @@ namespace Mist { capa["optional"]["nonchunked"]["name"] = "Send whole segments"; capa["optional"]["nonchunked"]["help"] = "Disables chunked transfer encoding, forcing per-segment buffering. Reduces performance significantly, but increases compatibility somewhat."; capa["optional"]["nonchunked"]["option"] = "--nonchunked"; + + cfg->addOption("mergesessions", JSON::fromString("{\"short\":\"M\",\"long\":\"mergesessions\",\"help\":\"Merge together sessions from one user into a single session.\"}")); + capa["optional"]["mergesessions"]["name"] = "Merge sessions"; + capa["optional"]["mergesessions"]["help"] = "If enabled, merges together all views from a single user into a single combined session. If disabled, each view (main playlist request) is a separate session."; + capa["optional"]["mergesessions"]["option"] = "--mergesessions"; /*LTS-END*/ } diff --git a/src/output/output_hls.h b/src/output/output_hls.h index 203481bc..f6013e0e 100644 --- a/src/output/output_hls.h +++ b/src/output/output_hls.h @@ -15,7 +15,7 @@ namespace Mist { std::string h264init(const std::string & initData); std::string h265init(const std::string & initData); - bool hasSessionIDs(){return true;} + bool hasSessionIDs(){return !config->getBool("mergesessions");} std::string liveIndex(); std::string liveIndex(int tid, std::string & sessId);