Fixed progress display when switching from "pause" to "slow back"

This commit is contained in:
Klaus Schmidinger 2025-02-18 15:37:24 +01:00
parent ebbaa39098
commit 7817e64695
3 changed files with 11 additions and 5 deletions

View File

@ -3816,3 +3816,5 @@ Jose Angel <joseangelpp@gmail.com>
Andreas Baierl <post@andreasbaierl.de> Andreas Baierl <post@andreasbaierl.de>
for implementing scaling images for implementing scaling images
for reporting a problem in the progress display when switching from "pause" to
"slow back"

View File

@ -10034,7 +10034,7 @@ Video Disk Recorder Revision History
(suggested by Stefan Hofmann). (suggested by Stefan Hofmann).
- Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann). - Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann).
2025-02-17: 2025-02-18:
- Removed all DEPRECATED_* code. - Removed all DEPRECATED_* code.
- Fixed error checking in case the fps value can't be determined by the frame parser. - 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. versions. Use proper locking instead.
- Fixed unnecessary redisplays of menus. - Fixed unnecessary redisplays of menus.
- Added '~' to the list of delimiters in cTextWrapper (thanks to Stefan Hofmann). - 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).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "dvbplayer.h"
@ -36,7 +36,7 @@ public:
bool IsEmpty(void); bool IsEmpty(void);
void Put(uint32_t Pts, int Index, bool Independent); void Put(uint32_t Pts, int Index, bool Independent);
int FindIndex(uint32_t Pts); int FindIndex(uint32_t Pts);
int FindFrameNumber(uint32_t Pts); int FindFrameNumber(uint32_t Pts, bool Forward);
}; };
cPtsIndex::cPtsIndex(void) cPtsIndex::cPtsIndex(void)
@ -90,8 +90,10 @@ int cPtsIndex::FindIndex(uint32_t Pts)
return Index; 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); cMutexLock MutexLock(&mutex);
if (w == r) if (w == r)
return lastFound; // replay always starts at an I frame 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) bool cDvbPlayer::GetFrameNumber(int &Current, int &Total)
{ {
if (index) { if (index) {
Current = ptsIndex.FindFrameNumber(DeviceGetSTC()); Current = ptsIndex.FindFrameNumber(DeviceGetSTC(), playDir == pdForward);
Total = index->Last(); Total = index->Last();
return true; return true;
} }