From 178c888e568e5698bbbc49831b76b99019e37ded Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 29 Sep 2017 16:20:51 +0200 Subject: [PATCH] Removed minSkipAhead, improved seeking algorithm. --- src/output/output.cpp | 3 +-- src/output/output.h | 1 - src/output/output_rtmp.cpp | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/output/output.cpp b/src/output/output.cpp index ad7be174..3f7539da 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -65,7 +65,6 @@ namespace Mist{ needsLookAhead = 0; lastStats = 0; maxSkipAhead = 7500; - minSkipAhead = 5000; realTime = 1000; lastRecv = Util::epoch(); if (myConn){ @@ -703,7 +702,7 @@ namespace Mist{ if (realTime){ uint8_t i = 6; while (--i && thisPacket.getTime() > (((Util::getMS() - firstTime)*1000)+maxSkipAhead)/realTime && keepGoing()){ - Util::sleep(std::min(thisPacket.getTime() - (((Util::getMS() - firstTime)*1000)+minSkipAhead)/realTime, 1000llu)); + Util::sleep(std::min(thisPacket.getTime() - (((Util::getMS() - firstTime)*1000)+maxSkipAhead)/realTime, 1000llu)); stats(); } } diff --git a/src/output/output.h b/src/output/output.h index 6412322e..0969da7b 100644 --- a/src/output/output.h +++ b/src/output/output.h @@ -102,7 +102,6 @@ namespace Mist { //stream delaying variables unsigned int maxSkipAhead;///< Maximum ms that we will go ahead of the intended timestamps. - unsigned int minSkipAhead;///< Minimum ms that we will go ahead of the intended timestamps. unsigned int realTime;///< Playback speed in ms of data per second. eg: 0 is infinite, 1000 real-time, 5000 is 0.2X speed, 500 = 2X speed. uint32_t needsLookAhead;///< Amount of millis we need to be able to look ahead in the metadata diff --git a/src/output/output_rtmp.cpp b/src/output/output_rtmp.cpp index 85641a3b..7e477f90 100644 --- a/src/output/output_rtmp.cpp +++ b/src/output/output_rtmp.cpp @@ -33,7 +33,6 @@ namespace Mist { } setBlocking(false); maxSkipAhead = 1500; - minSkipAhead = 500; } bool OutRTMP::onFinish(){