From 3ee83644f3e32f05e144663accd58f854ebd18b2 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 11 Oct 2016 15:04:52 +0200 Subject: [PATCH] Added options to DTSC pull for controlling the buffer config. Made 8X target duration the default buffer size. Inputs now wait for INPUT_TIMEOUT *and* two biggestFragment durations, added a few helper functions to DTSC::Meta. Buffer now automatically sets segment size to min(configed_size, biggest_fragment/2) to prevent sudden reductions of fragment sizes by more than 50% --- src/input/input_buffer.cpp | 7 +++++-- src/input/input_dtsc.cpp | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/input/input_buffer.cpp b/src/input/input_buffer.cpp index 35a90849..4ccf7113 100644 --- a/src/input/input_buffer.cpp +++ b/src/input/input_buffer.cpp @@ -897,7 +897,7 @@ namespace Mist { } //if the new value is different, print a message and apply it if (cutTime != tmpNum) { - DEBUG_MSG(DLVL_DEVEL, "Setting cutTime from %u to new value of %lli", cutTime, tmpNum); + INFO_MSG("Setting cutTime from %u to new value of %lli", cutTime, tmpNum); cutTime = tmpNum; } @@ -931,9 +931,12 @@ namespace Mist { tmpNum = config->getOption("segmentsize").asInt(); } } + if (tmpNum < myMeta.biggestFragment()/2){ + tmpNum = myMeta.biggestFragment()/2; + } //if the new value is different, print a message and apply it if (segmentSize != tmpNum) { - DEBUG_MSG(DLVL_DEVEL, "Setting segmentSize from %u to new value of %lli", segmentSize, tmpNum); + INFO_MSG("Setting segmentSize from %u to new value of %lli", segmentSize, tmpNum); segmentSize = tmpNum; } /*LTS-END*/ diff --git a/src/input/input_dtsc.cpp b/src/input/input_dtsc.cpp index 236304d1..d53e1b1a 100644 --- a/src/input/input_dtsc.cpp +++ b/src/input/input_dtsc.cpp @@ -40,6 +40,21 @@ namespace Mist { capa["optional"]["DVR"]["option"] = "--buffer"; capa["optional"]["DVR"]["type"] = "uint"; capa["optional"]["DVR"]["default"] = 50000LL; + /*LTS-START*/ + option.null(); + option["arg"] = "integer"; + option["long"] = "segment-size"; + option["short"] = "S"; + option["help"] = "Target time duration in milliseconds for segments"; + option["value"].append(5000LL); + config->addOption("segmentsize", option); + capa["optional"]["segmentsize"]["name"] = "Segment size (ms)"; + capa["optional"]["segmentsize"]["help"] = "Target time duration in milliseconds for segments."; + capa["optional"]["segmentsize"]["option"] = "--segment-size"; + capa["optional"]["segmentsize"]["type"] = "uint"; + capa["optional"]["segmentsize"]["default"] = 5000LL; + /*LTS-END*/ + } bool inputDTSC::needsLock(){