Segmenter: added noendlist url param to omit the ENDLIST tag
This commit is contained in:
parent
0ad88e80b3
commit
d2d4b0acbe
2 changed files with 12 additions and 2 deletions
|
@ -781,6 +781,12 @@ void Util::Config::addStandardPushCapabilities(JSON::Value &cap){
|
|||
pp["maxwaittrackms"]["unit"] = "ms";
|
||||
pp["maxwaittrackms"]["sort"] = "be";
|
||||
|
||||
pp["noendlist"]["name"] = "Don't end playlist";
|
||||
pp["noendlist"]["help"] = "If set, does not write #X-EXT-ENDLIST when finalizing the playlist on exit";
|
||||
pp["noendlist"]["type"] = "bool";
|
||||
pp["noendlist"]["format"] = "set_or_unset";
|
||||
pp["noendlist"]["sort"] = "bfa";
|
||||
|
||||
pp["append"]["name"] = "Append to file";
|
||||
pp["append"]["help"] = "If set to any value, will (if possible) append to an existing file, rather than overwriting it";
|
||||
pp["append"]["type"] = "bool";
|
||||
|
|
|
@ -1446,6 +1446,7 @@ namespace Mist{
|
|||
bool autoAdjustSplit = false;
|
||||
Socket::Connection plsConn;
|
||||
uint64_t systemBoot;
|
||||
bool addEndlist = true;
|
||||
|
||||
std::string origTarget;
|
||||
const char* origTargetPtr = getenv("MST_ORIG_TARGET");
|
||||
|
@ -1488,6 +1489,9 @@ namespace Mist{
|
|||
if (targetParams.count("adjustSplit")){
|
||||
autoAdjustSplit = true;
|
||||
}
|
||||
if (targetParams.count("noendlist")){
|
||||
addEndlist = false;
|
||||
}
|
||||
// When segmenting to a playlist, handle any existing files and init some data
|
||||
if (targetParams.count("m3u8")){
|
||||
// Load system boot time from the global config
|
||||
|
@ -1897,8 +1901,8 @@ namespace Mist{
|
|||
tmp << "#EXTINF:" << std::fixed << std::setprecision(3) << (lastPacketTime - currentStartTime) / 1000.0 << ",\n"+ segment + "\n";
|
||||
playlistBuffer += tmp.str();
|
||||
}
|
||||
|
||||
if (!M.getLive() || (!maxEntries && !targetAge)){playlistBuffer += "#EXT-X-ENDLIST\n";}
|
||||
// Omit the ENDLIST tag for sliding window live playlists (or when explicitly requested to omit it)
|
||||
if ((!M.getLive() || (!maxEntries && !targetAge)) && addEndlist){playlistBuffer += "#EXT-X-ENDLIST\n";}
|
||||
// Remove older entries in the playlist
|
||||
if (maxEntries || targetAge){
|
||||
uint64_t unixMs = M.getBootMsOffset() + systemBoot + currentStartTime;
|
||||
|
|
Loading…
Add table
Reference in a new issue