Fixed skipahead playback timing

This commit is contained in:
Thulinma 2020-07-07 20:59:21 +02:00
parent 0870a91e12
commit 1bbc378458

View file

@ -1171,9 +1171,9 @@ namespace Mist{
// slow down processing, if real time speed is wanted // slow down processing, if real time speed is wanted
if (realTime){ if (realTime){
uint8_t i = 6; uint8_t i = 6;
while (--i && thisPacket.getTime() > ((((Util::bootMS() - firstTime) * 1000) + maxSkipAhead) / realTime) && while (--i && thisPacket.getTime() > (((Util::bootMS() - firstTime) * 1000) / realTime + maxSkipAhead) &&
keepGoing()){ keepGoing()){
uint64_t amount = thisPacket.getTime() - ((((Util::bootMS() - firstTime) * 1000) + maxSkipAhead) / realTime); uint64_t amount = thisPacket.getTime() - (((Util::bootMS() - firstTime) * 1000) / realTime + maxSkipAhead);
if (amount > 1000){amount = 1000;} if (amount > 1000){amount = 1000;}
Util::sleep(amount); Util::sleep(amount);
//Make sure we stay responsive to requests and stats while waiting //Make sure we stay responsive to requests and stats while waiting