From a2a215d5e12ad35df8d0731dd00b6e41d5dd77fa Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 25 Aug 2002 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.1.8=20-=20Fixed=20replaying=20the=20last=20?= =?UTF-8?q?few=20seconds=20of=20a=20recording.=20-=20Added=20some=20missin?= =?UTF-8?q?g=20#includes=20to=20files=20in=20libdtv=20for=20gcc=203.2=20(t?= =?UTF-8?q?hanks=20to=20J=C3=BCrgen=20=20=20Zimmermann).=20-=20Added=20cDe?= =?UTF-8?q?vice::NewOsd()=20to=20allow=20a=20derived=20cDevice=20class=20t?= =?UTF-8?q?o=20implement=20its=20own=20=20=20OSD=20capabilities=20(thanks?= =?UTF-8?q?=20to=20Andreas=20Schultz).=20-=20Added=20cPalette::AllColors()?= =?UTF-8?q?=20for=20plugins=20that=20need=20to=20get=20the=20color=20entri?= =?UTF-8?q?es=20of=20=20=20a=20cPalette=20(see=20osdbase.h).=20-=20The=20n?= =?UTF-8?q?ew=20SVDRP=20command=20CLRE=20can=20be=20used=20to=20clear=20th?= =?UTF-8?q?e=20entire=20EPG=20data=20(suggested=20=20=20by=20Matthias=20Sc?= =?UTF-8?q?hniedermeyer).=20-=20Fixed=20handling=20one-shot=20timers=20tha?= =?UTF-8?q?t=20were=20already=20recording=20and=20had=20their=20start=20?= =?UTF-8?q?=20=20time=20changed=20into=20the=20future=20(thanks=20to=20Mat?= =?UTF-8?q?thias=20Schniedermeyer=20for=20reporting=20=20=20this=20one).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvbplayer.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'dvbplayer.c') diff --git a/dvbplayer.c b/dvbplayer.c index 2ca5a62..7a6d76d 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 1.11 2002/08/16 09:16:38 kls Exp $ + * $Id: dvbplayer.c 1.12 2002/08/24 14:59:35 kls Exp $ */ #include "dvbplayer.h" @@ -307,7 +307,7 @@ void cDvbPlayer::Action(void) isyslog("resuming replay at index %d (%s)", readIndex, IndexToHMSF(readIndex, true)); running = true; - while (running && NextFile()) { + while (running && (NextFile() || readIndex >= 0 || ringBuffer->Available())) { cPoller Poller; if (!readFrame) Poller.Add(replayFile, false); @@ -317,7 +317,7 @@ void cDvbPlayer::Action(void) // Read the next frame from the file: - if (!readFrame) { + if (!readFrame && (replayFile >= 0 || readIndex >= 0)) { if (playMode != pmStill) { int r = 0; if (playMode == pmFast || (playMode == pmSlow && playDir == pdBackward)) { @@ -326,7 +326,7 @@ void cDvbPlayer::Action(void) int Index = index->GetNextIFrame(readIndex, playDir == pdForward, &FileNumber, &FileOffset, &Length, true); if (Index >= 0) { if (!NextFile(FileNumber, FileOffset)) - break; + continue; } else { // can't call Play() here, because those functions may only be @@ -347,8 +347,11 @@ void cDvbPlayer::Action(void) uchar FileNumber; int FileOffset, Length; readIndex++; - if (!(index->Get(readIndex, &FileNumber, &FileOffset, NULL, &Length) && NextFile(FileNumber, FileOffset))) - break; + if (!(index->Get(readIndex, &FileNumber, &FileOffset, NULL, &Length) && NextFile(FileNumber, FileOffset))) { + readIndex = -1; + eof = true; + continue; + } r = ReadFrame(replayFile, b, Length, sizeof(b)); } else // allows replay even if the index file is missing @@ -557,7 +560,7 @@ void cDvbPlayer::SkipSeconds(int Seconds) if (Index > 0) Index = index->GetNextIFrame(Index, false, NULL, NULL, NULL, true); if (Index >= 0) - readIndex = writeIndex = Index - 1; // Input() will first increment it! + readIndex = writeIndex = Index - 1; // Action() will first increment it! } Play(); } -- cgit v1.2.3