From cc8d16ece75f4526f1cbd71548f0a95e2f7e001d Mon Sep 17 00:00:00 2001 From: kontell Date: Sun, 26 Apr 2026 15:53:58 +0100 Subject: [PATCH 1/3] Fix catchup stream backward skip on EOF near live edge When a terminating catchup stream hits EOF, the restart used m_previousLiveBufferOffset (set at last seek time) which was stale. This caused playback to jump backward by however far the stream had advanced since the last seek. Use m_currentDemuxTime instead so the stream continues from where playback actually was. Co-Authored-By: Claude Opus 4.6 --- src/stream/FFmpegCatchupStream.cpp | 5 +++-- src/stream/FFmpegCatchupStream.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/stream/FFmpegCatchupStream.cpp b/src/stream/FFmpegCatchupStream.cpp index 31e7ee79..754be662 100644 --- a/src/stream/FFmpegCatchupStream.cpp +++ b/src/stream/FFmpegCatchupStream.cpp @@ -122,10 +122,11 @@ DEMUX_PACKET* FFmpegCatchupStream::DemuxRead() { if (!m_lastPacketWasAvoidedEOF) { - Log(LOGLEVEL_INFO, "%s - EOF detected on terminating catchup stream, starting continuing stream at offset: %lld, ending offset approx %lld", __FUNCTION__, m_previousLiveBufferOffset, static_cast(std::time(nullptr) - m_catchupBufferStartTime)); + long long currentDemuxSecs = static_cast(m_currentDemuxTime) / 1000; + Log(LOGLEVEL_INFO, "%s - EOF detected on terminating catchup stream, starting continuing stream at offset: %lld, ending offset approx %lld", __FUNCTION__, currentDemuxSecs, static_cast(std::time(nullptr) - m_catchupBufferStartTime)); m_seekCorrectsEOF = true; - DemuxSeekTime(m_previousLiveBufferOffset * 1000); + DemuxSeekTime(m_currentDemuxTime); m_seekCorrectsEOF = false; } m_lastPacketWasAvoidedEOF = true; diff --git a/src/stream/FFmpegCatchupStream.h b/src/stream/FFmpegCatchupStream.h index df2f493c..6e27d68f 100644 --- a/src/stream/FFmpegCatchupStream.h +++ b/src/stream/FFmpegCatchupStream.h @@ -77,8 +77,8 @@ class FFmpegCatchupStream : public FFmpegStream bool m_isOpeningStream; double m_seekOffset; - double m_pauseStartTime; - double m_currentDemuxTime; + double m_pauseStartTime = 0; + double m_currentDemuxTime = 0; long long m_previousLiveBufferOffset = 0; bool m_lastSeekWasLive = false; From 0ba50d537a39348aa03248be6c62394654a96b70 Mon Sep 17 00:00:00 2001 From: kontell <91025994+kontell@users.noreply.github.com> Date: Fri, 8 May 2026 11:23:42 +0100 Subject: [PATCH 2/3] Update changelog.txt --- inputstream.ffmpegdirect/changelog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inputstream.ffmpegdirect/changelog.txt b/inputstream.ffmpegdirect/changelog.txt index 443b2a78..36d16344 100644 --- a/inputstream.ffmpegdirect/changelog.txt +++ b/inputstream.ffmpegdirect/changelog.txt @@ -1,3 +1,7 @@ +v22.2.5 +- Fix catchup stream backward skip on EOF near live edge +- Fix 6s close delay on timeshift HLS streams + v22.2.4 - Release From 61944c675e3aa1ac61303c6d89544b31ef6dfabd Mon Sep 17 00:00:00 2001 From: kontell <91025994+kontell@users.noreply.github.com> Date: Fri, 8 May 2026 11:24:01 +0100 Subject: [PATCH 3/3] Update addon.xml.in --- inputstream.ffmpegdirect/addon.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inputstream.ffmpegdirect/addon.xml.in b/inputstream.ffmpegdirect/addon.xml.in index 30a08207..006a32f2 100644 --- a/inputstream.ffmpegdirect/addon.xml.in +++ b/inputstream.ffmpegdirect/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@