From bd174d6db036fbcac28f67e340d766ba37b1a10a Mon Sep 17 00:00:00 2001 From: Thulinma Date: Fri, 29 Jul 2016 09:48:43 +0200 Subject: [PATCH] Fix seek-to-end issues with very near-live outputs --- src/output/output.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/output/output.cpp b/src/output/output.cpp index f4258026..d34f4283 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -488,6 +488,14 @@ namespace Mist { } bool Output::seek(unsigned int tid, unsigned long long pos, bool getNextKey){ + if (myMeta.live && myMeta.tracks[tid].lastms < pos){ + unsigned int maxTime = 0; + while (myMeta.tracks[tid].lastms < pos && myConn && ++maxTime <= 20){ + Util::wait(500); + stats(); + updateMeta(); + } + } if (myMeta.tracks[tid].lastms < pos){ WARN_MSG("Aborting seek to %llums in track %u: past end of track (= %llums).", pos, tid, myMeta.tracks[tid].lastms); selectedTracks.erase(tid);