Tweaked buffer size for HLS some more

This commit is contained in:
Thulinma 2016-06-27 13:21:54 +02:00
parent 9e391915df
commit fcc1dbd24f

View file

@ -218,12 +218,12 @@ namespace Mist {
if (!myMeta.tracks[tid].keys.size()) { if (!myMeta.tracks[tid].keys.size()) {
return false; return false;
} }
if (config->is_active && Trk.fragments.size() > 1){ if (config->is_active && Trk.fragments.size() > 2){
///Make sure we have at least 3X the target duration. ///Make sure we have at least 3X the target duration.
//The target duration is the biggest fragment, rounded up to whole seconds. //The target duration is the biggest fragment, rounded up to whole seconds.
uint32_t targetDuration = (Trk.biggestFragment() / 1000 + 1) * 1000; uint32_t targetDuration = (Trk.biggestFragment() / 1000 + 1) * 1000;
//The start is the second fragment's begin //The start is the third fragment's begin
uint32_t fragStart = Trk.getKey((++Trk.fragments.begin())->getNumber()).getTime(); uint32_t fragStart = Trk.getKey((++(++Trk.fragments.begin()))->getNumber()).getTime();
//The end is the last fragment's begin //The end is the last fragment's begin
uint32_t fragEnd = Trk.getKey(Trk.fragments.rbegin()->getNumber()).getTime(); uint32_t fragEnd = Trk.getKey(Trk.fragments.rbegin()->getNumber()).getTime();
if ((fragEnd - fragStart) < targetDuration * 3){ if ((fragEnd - fragStart) < targetDuration * 3){