From 0a5eb88696738110bc796ff8b71199d9396021e1 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 1 Feb 2015 11:20:54 +0100 Subject: Fixed setting the read index in cDvbPlayer::Goto() in case Still is false; The function cDvbPlayer::Goto() now automatically calls Play() if Still is false --- HISTORY | 4 +++- dvbplayer.c | 30 +++++++++++++++++++----------- dvbplayer.h | 4 ++-- menu.c | 14 +++----------- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/HISTORY b/HISTORY index 966e30e1..0db2800d 100644 --- a/HISTORY +++ b/HISTORY @@ -8414,7 +8414,7 @@ Video Disk Recorder Revision History generated an index file with VDR version 2.0.6 you may want to do so again with this version to make sure the index is OK. -2015-01-31: Version 2.1.8 +2015-02-01: Version 2.1.8 - Updated the Italian OSD texts (thanks to Diego Pierotto). - Fixed "warning: invalid suffix on literal" with GCC 4.8 and C++11 (thanks to Joerg @@ -8449,3 +8449,5 @@ Video Disk Recorder Revision History - Added ARGSDIR to the ONEDIR section of Make.config.template (suggested by Derek Kelly). - Made cRecording::GetResume() public (suggested by Stefan Braun). +- Fixed setting the read index in cDvbPlayer::Goto() in case Still is false. +- The function cDvbPlayer::Goto() now automatically calls Play() if Still is false. diff --git a/dvbplayer.c b/dvbplayer.c index 1b049f26..0d7b3904 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 3.2 2015/01/25 13:12:13 kls Exp $ + * $Id: dvbplayer.c 3.3 2015/02/01 10:45:41 kls Exp $ */ #include "dvbplayer.h" @@ -852,18 +852,26 @@ void cDvbPlayer::Goto(int Index, bool Still) off_t FileOffset; int Length; Index = index->GetNextIFrame(Index, false, &FileNumber, &FileOffset, &Length); - if (Index >= 0 && NextFile(FileNumber, FileOffset) && Still) { - uchar b[MAXFRAMESIZE]; - int r = ReadFrame(replayFile, b, Length, sizeof(b)); - if (r > 0) { - if (playMode == pmPause) - DevicePlay(); - DeviceStillPicture(b, r); - ptsIndex.Put(isPesRecording ? PesGetPts(b) : TsGetPts(b, r), Index); + if (Index >= 0) { + if (Still) { + if (NextFile(FileNumber, FileOffset)) { + uchar b[MAXFRAMESIZE]; + int r = ReadFrame(replayFile, b, Length, sizeof(b)); + if (r > 0) { + if (playMode == pmPause) + DevicePlay(); + DeviceStillPicture(b, r); + ptsIndex.Put(isPesRecording ? PesGetPts(b) : TsGetPts(b, r), Index); + } + playMode = pmStill; + readIndex = Index; + } + } + else { + readIndex = Index - 1; // Action() will first increment it! + Play(); } - playMode = pmStill; } - readIndex = Index; } } diff --git a/dvbplayer.h b/dvbplayer.h index e2f2082d..678c9693 100644 --- a/dvbplayer.h +++ b/dvbplayer.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbplayer.h 2.1 2012/02/19 11:40:36 kls Exp $ + * $Id: dvbplayer.h 3.1 2015/02/01 11:20:54 kls Exp $ */ #ifndef __DVBPLAYER_H @@ -56,7 +56,7 @@ public: // and >0 if this is multi speed mode. void Goto(int Index, bool Still = false); // Positions to the given index and displays that frame as a still picture - // if Still is true. + // if Still is true. If Still is false, Play() will be called. }; #endif //__DVBPLAYER_H diff --git a/menu.c b/menu.c index d1b3af47..16f98c45 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 3.34 2015/01/31 14:50:55 kls Exp $ + * $Id: menu.c 3.35 2015/02/01 10:42:11 kls Exp $ */ #include "menu.h" @@ -5262,8 +5262,6 @@ void cReplayControl::TimeSearchProcess(eKeys Key) Seconds = min(Total - STAY_SECONDS_OFF_END, Seconds); bool Still = Key == kDown || Key == kPause || Key == kOk; Goto(SecondsToFrames(Seconds, FramesPerSecond()), Still); - if (!Still) - Play(); } timeSearchActive = false; break; @@ -5332,7 +5330,6 @@ void cReplayControl::MarkJump(bool Forward) int Speed; if (GetReplayMode(Playing, Fwd, Speed) && Playing && Forward && m->Position() < Total - SecondsToFrames(3, FramesPerSecond())) { Goto(m->Position()); - Play(); return; } } @@ -5379,11 +5376,8 @@ void cReplayControl::MarkMove(int Frames, bool MarkRequired) Goto(m->Position(), true); marksModified = true; } - else if (!MarkRequired) { + else if (!MarkRequired) Goto(SkipFrames(Frames), !Play); - if (Play) - this->Play(); - } } } @@ -5419,10 +5413,8 @@ void cReplayControl::EditTest(void) if (m) { if ((m->Index() & 0x01) != 0 && !Setup.SkipEdited) // when skipping edited parts we also need to jump to end marks m = marks.Next(m); - if (m) { + if (m) Goto(m->Position() - SecondsToFrames(3, FramesPerSecond())); - Play(); - } } } } -- cgit v1.2.3