Merge branch 'development' into LTS_development

This commit is contained in:
Thulinma 2016-10-11 15:04:11 +02:00
commit 915a10207b
6 changed files with 70 additions and 10 deletions

View file

@ -207,7 +207,7 @@ namespace Mist {
DEBUG_MSG(DLVL_DEVEL, "Input for stream %s started", streamName.c_str());
long long int activityCounter = Util::bootSecs();
while ((Util::bootSecs() - activityCounter) < INPUT_TIMEOUT && config->is_active) { //15 second timeout
while (((Util::bootSecs() - activityCounter) < INPUT_TIMEOUT || (myMeta.live && (Util::bootSecs() - activityCounter) < myMeta.biggestFragment()/500)) && config->is_active) { //15 second timeout
userPage.parseEach(callbackWrapper);
removeUnused();
if (userPage.connectedUsers) {

View file

@ -289,14 +289,14 @@ namespace Mist {
return false;
}
if (config->is_active && Trk.fragments.size() > 2){
///Make sure we have at least 3X the target duration.
///Make sure we have at least 8X the target duration.
//The target duration is the biggest fragment, rounded up to whole seconds.
uint32_t targetDuration = (Trk.biggestFragment() / 1000 + 1) * 1000;
//The start is the third fragment's begin
uint32_t fragStart = Trk.getKey((++(++Trk.fragments.begin()))->getNumber()).getTime();
//The end is the last fragment's begin
uint32_t fragEnd = Trk.getKey(Trk.fragments.rbegin()->getNumber()).getTime();
if ((fragEnd - fragStart) < targetDuration * 3){
if ((fragEnd - fragStart) < targetDuration * 8){
return false;
}
}
@ -915,7 +915,7 @@ namespace Mist {
}
//if the new value is different, print a message and apply it
if (resumeMode != (bool)tmpNum) {
DEBUG_MSG(DLVL_DEVEL, "Setting resume mode from %s to new value of %s", resumeMode ? "enabled" : "disabled", tmpNum ? "enabled" : "disabled");
INFO_MSG("Setting resume mode from %s to new value of %s", resumeMode ? "enabled" : "disabled", tmpNum ? "enabled" : "disabled");
resumeMode = tmpNum;
}

View file

@ -26,6 +26,20 @@ namespace Mist {
capa["codecs"][0u][1u].append("AAC");
capa["codecs"][0u][1u].append("MP3");
capa["codecs"][0u][1u].append("vorbis");
JSON::Value option;
option["arg"] = "integer";
option["long"] = "buffer";
option["short"] = "b";
option["help"] = "Live stream DVR buffer time in ms";
option["value"].append(50000LL);
config->addOption("bufferTime", option);
capa["optional"]["DVR"]["name"] = "Buffer time (ms)";
capa["optional"]["DVR"]["help"] = "The target available buffer time for this live stream, in milliseconds. This is the time available to seek around in, and will automatically be extended to fit whole keyframes as well as the minimum duration needed for stable playback.";
capa["optional"]["DVR"]["option"] = "--buffer";
capa["optional"]["DVR"]["type"] = "uint";
capa["optional"]["DVR"]["default"] = 50000LL;
}
bool inputDTSC::needsLock(){