From 7817e646954bbf6b61c6e554fd2c8b4c2dfde9cf Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Tue, 18 Feb 2025 15:37:24 +0100 Subject: [PATCH] Fixed progress display when switching from "pause" to "slow back" --- CONTRIBUTORS | 2 ++ HISTORY | 4 +++- dvbplayer.c | 10 ++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index ca687665..6692078f 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3816,3 +3816,5 @@ Jose Angel Andreas Baierl for implementing scaling images + for reporting a problem in the progress display when switching from "pause" to + "slow back" diff --git a/HISTORY b/HISTORY index 141406de..a0ee48e7 100644 --- a/HISTORY +++ b/HISTORY @@ -10034,7 +10034,7 @@ Video Disk Recorder Revision History (suggested by Stefan Hofmann). - Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann). -2025-02-17: +2025-02-18: - Removed all DEPRECATED_* code. - Fixed error checking in case the fps value can't be determined by the frame parser. @@ -10083,3 +10083,5 @@ Video Disk Recorder Revision History versions. Use proper locking instead. - Fixed unnecessary redisplays of menus. - Added '~' to the list of delimiters in cTextWrapper (thanks to Stefan Hofmann). +- Fixed progress display when switching from "pause" to "slow back" (reported by Andreas + Baierl). diff --git a/dvbplayer.c b/dvbplayer.c index c36fac70..0a6638d9 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbplayer.c 5.4 2024/09/19 09:49:02 kls Exp $ + * $Id: dvbplayer.c 5.5 2025/02/18 15:37:24 kls Exp $ */ #include "dvbplayer.h" @@ -36,7 +36,7 @@ public: bool IsEmpty(void); void Put(uint32_t Pts, int Index, bool Independent); int FindIndex(uint32_t Pts); - int FindFrameNumber(uint32_t Pts); + int FindFrameNumber(uint32_t Pts, bool Forward); }; cPtsIndex::cPtsIndex(void) @@ -90,8 +90,10 @@ int cPtsIndex::FindIndex(uint32_t Pts) return Index; } -int cPtsIndex::FindFrameNumber(uint32_t Pts) +int cPtsIndex::FindFrameNumber(uint32_t Pts, bool Forward) { + if (!Forward) + return FindIndex(Pts); // there are only I frames in backward cMutexLock MutexLock(&mutex); if (w == r) return lastFound; // replay always starts at an I frame @@ -967,7 +969,7 @@ bool cDvbPlayer::GetIndex(int &Current, int &Total, bool SnapToIFrame) bool cDvbPlayer::GetFrameNumber(int &Current, int &Total) { if (index) { - Current = ptsIndex.FindFrameNumber(DeviceGetSTC()); + Current = ptsIndex.FindFrameNumber(DeviceGetSTC(), playDir == pdForward); Total = index->Last(); return true; }