diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-02-01 11:20:54 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-02-01 11:20:54 +0100 |
commit | 0a5eb88696738110bc796ff8b71199d9396021e1 (patch) | |
tree | 58cafad3d58ed1b25d7dcc391bfe9a90dfc8d3e0 /dvbplayer.c | |
parent | 63372cd4aa4670560698154973d8029ccdf68d9c (diff) | |
download | vdr-0a5eb88696738110bc796ff8b71199d9396021e1.tar.gz vdr-0a5eb88696738110bc796ff8b71199d9396021e1.tar.bz2 |
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
Diffstat (limited to 'dvbplayer.c')
-rw-r--r-- | dvbplayer.c | 30 |
1 files changed, 19 insertions, 11 deletions
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; } } |