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%

This commit is contained in:
Thulinma 2016-10-11 15:04:52 +02:00
parent 915a10207b
commit 3ee83644f3
2 changed files with 20 additions and 2 deletions

View file

@ -897,7 +897,7 @@ namespace Mist {
} }
//if the new value is different, print a message and apply it //if the new value is different, print a message and apply it
if (cutTime != tmpNum) { 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; cutTime = tmpNum;
} }
@ -931,9 +931,12 @@ namespace Mist {
tmpNum = config->getOption("segmentsize").asInt(); 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 the new value is different, print a message and apply it
if (segmentSize != tmpNum) { 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; segmentSize = tmpNum;
} }
/*LTS-END*/ /*LTS-END*/

View file

@ -40,6 +40,21 @@ namespace Mist {
capa["optional"]["DVR"]["option"] = "--buffer"; capa["optional"]["DVR"]["option"] = "--buffer";
capa["optional"]["DVR"]["type"] = "uint"; capa["optional"]["DVR"]["type"] = "uint";
capa["optional"]["DVR"]["default"] = 50000LL; 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(){ bool inputDTSC::needsLock(){