diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 2b214094..bbfab372 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3368,6 +3368,7 @@ Stefan Hofmann for suggesting to implement support for remote controls that only have a combined "Play/Pause" key instead of separate keys for "Play" and "Pause" for a fix for compilers that don't like non-constant format strings + for suggesting to implement jumping between errors while replaying a recording Stefan Blochberger for suggesting to automatically display the progress display whenever replay of a diff --git a/HISTORY b/HISTORY index 4e91ee50..1cb324c4 100644 --- a/HISTORY +++ b/HISTORY @@ -10030,3 +10030,5 @@ Video Disk Recorder Revision History (reported by Markus Ehrnsperger, fix suggested by Winfried Köhler). - Fixed expiring of one-time VPS timers in case there is more than one event with the same VPS time (suggested by Markus Ehrnsperger). +- The Channel+/- keys can now be used to jump between errors while replaying a recording + (suggested by Stefan Hofmann). diff --git a/MANUAL b/MANUAL index 9dca50ae..4233e54b 100644 --- a/MANUAL +++ b/MANUAL @@ -50,8 +50,8 @@ Version 2.7 Next Next/previous channel group (in live tv mode) Prev or next/previous editing mark (in replay mode) - Channel+ channel up - Channel- channel down + Channel+ channel up (live view), next error (replay) + Channel- channel down (live view), previous error (replay) PrevChannel previous channel Power shutdown diff --git a/menu.c b/menu.c index a5c429e3..413bfd36 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 5.17 2024/09/19 09:49:02 kls Exp $ + * $Id: menu.c 5.18 2024/10/11 14:10:50 kls Exp $ */ #include "menu.h" @@ -6097,6 +6097,47 @@ void cReplayControl::MarkMove(int Frames, bool MarkRequired) } } +void cReplayControl::ErrorJump(bool Forward) +{ + const cErrors *Errors = GetErrors(); + int NumErrors = Errors ? Errors->Size() : 0; + if (NumErrors > 0) { + int Current, Total; + if (GetIndex(Current, Total)) { + if (Forward) { + int Offset = 0; + for (int i = 0; i < NumErrors; i++) { + int Position = Errors->At(i); + if (Position > Current + Offset) { + int NextIFrame = SkipFrames(Position - Current) + Offset; // this takes us to the I-frame at or right after Position + if (NextIFrame > Position) { + if (SkipFrames(Offset + 1) == NextIFrame) { // means Current is the I-frame right before Position + Offset = NextIFrame - Current; + continue; + } + } + Goto(Position, true); // this takes us to the I-frame at or right before Position + return; + } + } + if (Current < Total) + Goto(Total, true); + } + else { + for (int i = NumErrors - 1; i >= 0; i--) { + if (Errors->At(i) < Current) { + int Position = Errors->At(i); + Goto(Position, true); // this takes us to the I-frame at or right before Position + return; + } + } + if (Current > 0) + Goto(0, true); + } + } + } +} + void cReplayControl::EditCut(void) { if (*fileName) { @@ -6241,6 +6282,10 @@ eOSState cReplayControl::ProcessKey(eKeys Key) case kMarkSkipBack: MarkMove(-adaptiveSkipper.GetValue(RAWKEY(Key)), false); break; case kMarkSkipForward|k_Repeat: case kMarkSkipForward: MarkMove(+adaptiveSkipper.GetValue(RAWKEY(Key)), false); break; + case kChanUp|k_Repeat: + case kChanUp: ErrorJump(true); break; + case kChanDn|k_Repeat: + case kChanDn: ErrorJump(false); break; case kEditCut: EditCut(); break; case kEditTest: EditTest(); break; default: { diff --git a/menu.h b/menu.h index 96c55e62..c3b32cf4 100644 --- a/menu.h +++ b/menu.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.h 5.4 2024/09/19 09:49:02 kls Exp $ + * $Id: menu.h 5.5 2024/10/11 14:10:50 kls Exp $ */ #ifndef __MENU_H @@ -316,6 +316,7 @@ private: void MarkToggle(void); void MarkJump(bool Forward); void MarkMove(int Frames, bool MarkRequired); + void ErrorJump(bool Forward); void EditCut(void); void EditTest(void); public: