From ad9e72798a0da7c0b7465da98fa6a2b4cf9b8dce Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 4 Jun 2021 15:42:54 +0200 Subject: [PATCH] Increase VoD lookahead from 20 to 120 seconds --- src/input/input.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/input/input.cpp b/src/input/input.cpp index 7977bf45..84831421 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -29,15 +29,15 @@ namespace Mist{ } //This is a bit tricky: //We want to make sure the next page is buffered before we need it, during playback. - //To do so, we grab the current key's time and make sure current key and everything 20 seconds after it, is loaded. + //To do so, we grab the current key's time and make sure current key and everything 120 seconds after it, is loaded. size_t key = users.getKeyNum(id); uint64_t time = M.getTimeForKeyIndex(track, key); - size_t endKey = M.getKeyIndexForTime(track, time + 20000); + size_t endKey = M.getKeyIndexForTime(track, time + 120000); //But! What if our current key is 20+ seconds long? HAVE YOU THOUGHT OF THAT?! //Exactly! I thought not! So, if the end key number == the first, we increase by one. if (endKey == key){++endKey;} for (size_t i = key; i <= endKey; i++){bufferFrame(track, i);} - //Now, we can rest assured that the next ~20 seconds or so is pre-buffered in RAM. + //Now, we can rest assured that the next ~120 seconds or so is pre-buffered in RAM. } void Input::userOnDisconnect(size_t id){} void Input::userLeadOut(){}