diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 39dcde13..ca9a31ae 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -54,6 +54,9 @@ Matthias Schniedermeyer for his "schnitt" tools for his "master-timer" tool for helping to debug the "move to last position in list" bug + for suggesting the SVDRP command CLRE + for reporting a bug in handling one-shot timers that were already recording + and had their start time changed into the future Miha Setina for translating OSD texts to the Slovenian language @@ -161,6 +164,8 @@ Andreas Schultz for adding direct access to the index data of cPalette (needed for displaying SPUs) for pointing out a possible race condition in the cDvbPlayer for making the use of malloc/free and new/delete consistent + for adding cDevice::NewOsd() to allow a derived cDevice class to implement its own + OSD capabilities Aaron Holtzman for writing 'ac3dec' @@ -380,3 +385,6 @@ Joerg Riechardt Holger Wächtler for some valuable advice during adapting to the NEWSTRUCT driver + +Jürgen Zimmermann + for adding some missing #includes to files in libdtv for gcc 3.2 diff --git a/HISTORY b/HISTORY index c7269cda..fd175766 100644 --- a/HISTORY +++ b/HISTORY @@ -1415,3 +1415,18 @@ Video Disk Recorder Revision History - VDR no longer gives up if there is no DVB device. It continues to work if there is at least one device, either a DVB device found by the core VDR code itself, or a device implemented by a plugin. + +2002-08-25: Version 1.1.8 + +- Fixed replaying the last few seconds of a recording. +- Added some missing #includes to files in libdtv for gcc 3.2 (thanks to Jürgen + Zimmermann). +- Added cDevice::NewOsd() to allow a derived cDevice class to implement its own + OSD capabilities (thanks to Andreas Schultz). +- Added cPalette::AllColors() for plugins that need to get the color entries of + a cPalette (see osdbase.h). +- The new SVDRP command CLRE can be used to clear the entire EPG data (suggested + by Matthias Schniedermeyer). +- Fixed handling one-shot timers that were already recording and had their start + time changed into the future (thanks to Matthias Schniedermeyer for reporting + this one). diff --git a/PLUGINS.html b/PLUGINS.html index ae164e1d..186316de 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -21,18 +21,18 @@ VDR program and present itself to the user. The inside interface provides the plugin code access to VDR's internal data structures and allows it to hook itself into specific areas to perform special actions.

-
  -Important modifications introduced in version 1.1.4 are marked like this. -
-
  +
  Important modifications introduced in version 1.1.5 are marked like this.
-
  +
  Important modifications introduced in version 1.1.6 are marked like this.
-
  +
  Important modifications introduced in version 1.1.7 are marked like this.
+
  +Important modifications introduced in version 1.1.8 are marked like this. +

Part I - The Outside Interface

@@ -907,7 +907,6 @@ See the file status.h for detailed information on which status monitor member functions are available in cStatus. You only need to implement the functions you actually want to use. -
 

Players

Play it again, Sam!

@@ -958,7 +957,7 @@ stream. There are no prerequisites regarding the length or alignment of an individual block of data. The sum of all blocks must simply result in the desired video data stream, and it must be delivered fast enough so that the DVB device doesn't run out of data. -
  +
  To avoid busy loops the player should call its member function


@@ -1065,9 +1064,8 @@ Of course, these are only suggestions which should make it easier for VDR users enjoy additional players, since they will be able to control them with actions that they already know. If you absolutely want to do things differently, just go ahead - it's your show... -
-
  +
 

Receivers

Tapping into the stream...

@@ -1123,7 +1121,7 @@ If the cReceiver isn't needed any more, it may simply be deleted and will automatically detach itself from the cDevice.

-
  +
 

The On Screen Display

Express yourself

@@ -1155,7 +1153,7 @@ of these functions, and VDR/osd.c to see how VDR opens the OSD and sets up its windows and color depths).

-
  +
 

Devices

Expanding the possibilities

@@ -1228,7 +1226,7 @@ to indicate this to VDR.

The functions to implement replaying capabilites are -
  +
 


virtual bool HasDecoder(void) const; virtual bool SetPlayMode(ePlayMode PlayMode); @@ -1252,6 +1250,25 @@ virtual void SetVideoFormat(bool VideoFormat16_9); virtual void SetVolumeDevice(int Volume);

+
  +

+On Screen Display +

+If your device provides On Screen Display (OSD) capabilities (which every device +that is supposed to be used as a primary device should do), it can implement +the function + +


+virtual cOsdBase *NewOsd(int x, int y); +

+ +which must return a newly created object of a derived cOsdBase class that +implements the functions necessary to display OSD information on your device. +The caller of this function will delete the object as soon as it is no longer +needed. +

+ +

Initializing new devices

A derived cDevice class shall implement a static function diff --git a/config.h b/config.h index ef7f70e6..fe8a1155 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.123 2002/08/11 11:36:36 kls Exp $ + * $Id: config.h 1.124 2002/08/24 10:23:48 kls Exp $ */ #ifndef __CONFIG_H @@ -20,7 +20,7 @@ #include "eit.h" #include "tools.h" -#define VDRVERSION "1.1.7" +#define VDRVERSION "1.1.8" #define MAXPRIORITY 99 #define MAXLIFETIME 99 diff --git a/device.c b/device.c index 6a310377..48f5d40f 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.12 2002/08/16 09:50:43 kls Exp $ + * $Id: device.c 1.13 2002/08/25 09:16:51 kls Exp $ */ #include "device.h" @@ -111,6 +111,11 @@ bool cDevice::HasDecoder(void) const return false; } +cOsdBase *cDevice::NewOsd(int x, int y) +{ + return NULL; +} + cDevice *cDevice::GetDevice(int Ca, int Priority, int Frequency, int Vpid, bool *ReUse) { if (ReUse) diff --git a/device.h b/device.h index 14d8ec50..5f62417a 100644 --- a/device.h +++ b/device.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 1.9 2002/08/16 08:52:27 kls Exp $ + * $Id: device.h 1.10 2002/08/25 09:16:34 kls Exp $ */ #ifndef __DEVICE_H @@ -43,6 +43,7 @@ enum ePlayMode { pmNone, // audio/video from decoder // KNOWN TO YOUR PLAYER. }; +class cOsdBase; class cChannel; class cPlayer; class cReceiver; @@ -129,6 +130,16 @@ public: virtual bool HasDecoder(void) const; // Tells whether this device has an MPEG decoder. +// OSD facilities + +public: + virtual cOsdBase *NewOsd(int x, int y); + // Creates a new cOsdBase object that can be used by the cOsd class + // to display information on the screen, with the upper left corner + // of the OSD at the given coordinates. If a derived cDevice doesn't + // implement this function, NULL will be returned by default (which + // means the device has no OSD capabilities). + // Channel facilities protected: diff --git a/dvbdevice.c b/dvbdevice.c index 6be882fa..52c7c3ba 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 1.7 2002/08/16 09:27:53 kls Exp $ + * $Id: dvbdevice.c 1.8 2002/08/25 09:20:53 kls Exp $ */ #include "dvbdevice.h" @@ -193,6 +193,11 @@ bool cDvbDevice::HasDecoder(void) const return fd_video >= 0 && fd_audio >= 0; } +cOsdBase *cDvbDevice::NewOsd(int x, int y) +{ + return new cDvbOsd(x, y); +} + bool cDvbDevice::GrabImage(const char *FileName, bool Jpeg, int Quality, int SizeX, int SizeY) { int videoDev = DvbOpen(DEV_VIDEO, CardIndex(), O_RDWR, true); diff --git a/dvbdevice.h b/dvbdevice.h index ece1b454..a338399b 100644 --- a/dvbdevice.h +++ b/dvbdevice.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.h 1.5 2002/08/16 08:53:30 kls Exp $ + * $Id: dvbdevice.h 1.6 2002/08/25 09:19:34 kls Exp $ */ #ifndef __DVBDEVICE_H @@ -48,6 +48,11 @@ public: virtual bool CanBeReUsed(int Frequency, int Vpid); virtual bool HasDecoder(void) const; +// OSD facilities + +public: + cOsdBase *NewOsd(int x, int y); + // Channel facilities private: diff --git a/dvbosd.c b/dvbosd.c index ca5cf490..4b0c1ea8 100644 --- a/dvbosd.c +++ b/dvbosd.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbosd.c 1.18 2002/08/04 10:13:21 kls Exp $ + * $Id: dvbosd.c 1.19 2002/08/25 09:53:51 kls Exp $ */ #include "dvbosd.h" @@ -92,7 +92,7 @@ void cDvbOsd::CommitWindow(cWindow *Window) // commit colors: int FirstColor = 0, LastColor = 0; const eDvbColor *pal; - while ((pal = Window->Colors(FirstColor, LastColor)) != NULL) + while ((pal = Window->NewColors(FirstColor, LastColor)) != NULL) Cmd(OSD_SetPalette, FirstColor, LastColor, 0, 0, 0, pal); // commit modified data: Cmd(OSD_SetBlock, Window->Width(), x1, y1, x2, y2, Window->Data(x1, y1)); diff --git a/dvbplayer.c b/dvbplayer.c index 2ca5a62d..7a6d76d3 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(); } diff --git a/eit.c b/eit.c index ca319138..86590490 100644 --- a/eit.c +++ b/eit.c @@ -16,7 +16,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: eit.c 1.48 2002/08/11 11:11:12 kls Exp $ + * $Id: eit.c 1.49 2002/08/25 10:43:36 kls Exp $ ***************************************************************************/ #include "eit.h" @@ -1035,6 +1035,13 @@ bool cSIProcessor::Read(FILE *f) return result; } +void cSIProcessor::Clear(void) +{ + cMutexLock MutexLock(&schedulesMutex); + delete schedules; + schedules = new cSchedules; +} + void cSIProcessor::SetEpgDataFileName(const char *FileName) { epgDataFileName = NULL; diff --git a/eit.h b/eit.h index 981f4e59..33a49a0e 100644 --- a/eit.h +++ b/eit.h @@ -16,7 +16,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: eit.h 1.17 2002/08/04 11:30:24 kls Exp $ + * $Id: eit.h 1.18 2002/08/25 10:38:34 kls Exp $ ***************************************************************************/ #ifndef __EIT_H @@ -156,6 +156,7 @@ public: // time the returned cSchedules is accessed. Once the cSchedules is no // longer used, the cMutexLock must be destroyed. static bool Read(FILE *f = NULL); + static void Clear(void); void SetStatus(bool On); void SetCurrentTransponder(int CurrentTransponder); static bool SetCurrentServiceID(unsigned short servid); diff --git a/libdtv/liblx/xListFuncs.c b/libdtv/liblx/xListFuncs.c index 7457170e..01b85b85 100644 --- a/libdtv/liblx/xListFuncs.c +++ b/libdtv/liblx/xListFuncs.c @@ -25,6 +25,7 @@ // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. +#include #include "liblx.h" diff --git a/libdtv/liblx/xMemMgt.c b/libdtv/liblx/xMemMgt.c index 8f619bc8..c93713b0 100644 --- a/libdtv/liblx/xMemMgt.c +++ b/libdtv/liblx/xMemMgt.c @@ -26,6 +26,8 @@ // Boston, MA 02111-1307, USA. #include +#include +#include #include #include "liblx.h" diff --git a/libdtv/libsi/si_parser.c b/libdtv/libsi/si_parser.c index 063d93e6..be0d2549 100644 --- a/libdtv/libsi/si_parser.c +++ b/libdtv/libsi/si_parser.c @@ -26,6 +26,7 @@ // Boston, MA 02111-1307, USA. #include +#include #include #include diff --git a/menu.c b/menu.c index 5b56b3ab..ea10a361 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 1.205 2002/08/15 11:28:08 kls Exp $ + * $Id: menu.c 1.206 2002/08/25 10:56:09 kls Exp $ */ #include "menu.h" @@ -2490,9 +2490,7 @@ void cRecordControl::Stop(bool KeepInstant) cStatus::MsgRecording(device, NULL); DELETENULL(recorder); timer->SetRecording(false); - if ((IsInstant() && !KeepInstant) || (timer->IsSingleEvent() && !timer->Matches())) { - // checking timer->Matches() to make sure we don't delete the timer - // if the program was cancelled before the timer's stop time! + if ((IsInstant() && !KeepInstant) || (timer->IsSingleEvent() && timer->StopTime() <= time(NULL))) { isyslog("deleting timer %d", timer->Index() + 1); Timers.Del(timer); Timers.Save(); diff --git a/osd.c b/osd.c index 58caf68c..a2daf603 100644 --- a/osd.c +++ b/osd.c @@ -4,13 +4,12 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.c 1.34 2002/08/15 11:20:44 kls Exp $ + * $Id: osd.c 1.35 2002/08/25 09:18:31 kls Exp $ */ #include "osd.h" #include #include "device.h" -#include "dvbosd.h" #include "i18n.h" #include "status.h" @@ -73,7 +72,7 @@ cOsdBase *cOsd::OpenRaw(int x, int y) #ifdef DEBUG_OSD return NULL; #else - return osd ? NULL : new cDvbOsd(x, y); + return osd ? NULL : cDevice::PrimaryDevice()->NewOsd(x, y); #endif } diff --git a/osdbase.c b/osdbase.c index 70e11bfa..e16b27b0 100644 --- a/osdbase.c +++ b/osdbase.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osdbase.c 1.6 2002/08/11 11:47:21 kls Exp $ + * $Id: osdbase.c 1.7 2002/08/25 10:02:36 kls Exp $ */ #include "osdbase.h" @@ -74,7 +74,7 @@ void cPalette::Reset(void) full = false; } -const eDvbColor *cPalette::Colors(int &FirstColor, int &LastColor) +const eDvbColor *cPalette::NewColors(int &FirstColor, int &LastColor) { for (FirstColor = 0; FirstColor < numColors; FirstColor++) { if (!fetched[FirstColor]) { @@ -87,6 +87,12 @@ const eDvbColor *cPalette::Colors(int &FirstColor, int &LastColor) return NULL; } +const eDvbColor *cPalette::AllColors(int &NumColors) +{ + NumColors = numColors; + return numColors ? color : NULL; +} + void cPalette::Take(const cPalette &Palette, tIndexes *Indexes) { for (int i = 0; i < Palette.numColors; i++) { diff --git a/osdbase.h b/osdbase.h index 1800482f..39221261 100644 --- a/osdbase.h +++ b/osdbase.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osdbase.h 1.4 2002/07/13 14:45:55 kls Exp $ + * $Id: osdbase.h 1.5 2002/08/25 10:01:00 kls Exp $ */ #ifndef __OSDBASE_H @@ -56,7 +56,18 @@ public: cPalette(int Bpp); int Index(eDvbColor Color); void Reset(void); - const eDvbColor *Colors(int &FirstColor, int &LastColor); + const eDvbColor *NewColors(int &FirstColor, int &LastColor); + // With every call this function returns a consecutive range of + // color entries that have been added since the last call. The + // return value is the address of the first new color, and the + // index of the first and last new color are returned in the given + // int parameters. If there are no new color entries, NULL will + // be returned. + const eDvbColor *AllColors(int &NumColors); + // Returns a pointer to the complete color table and stores the + // number of valid entries in NumColors. If no colors have been + // stored yet, NumColors will be set to 0 and the function will + // return NULL. void Take(const cPalette &Palette, tIndexes *Indexes = NULL); }; diff --git a/recording.c b/recording.c index be915400..c9234468 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 1.66 2002/08/11 11:48:11 kls Exp $ + * $Id: recording.c 1.67 2002/08/24 14:09:49 kls Exp $ */ #include "recording.h" @@ -756,6 +756,9 @@ void cRecordingUserCommand::InvokeCommand(const char *State, const char *Recordi // The maximum time to wait before giving up while catching up on an index file: #define MAXINDEXCATCHUP 2 // seconds +// The minimum age of an index file for considering it no longer to be written: +#define MININDEXAGE 10 // seconds + cIndexFile::cIndexFile(const char *FileName, bool Record) :resumeFile(FileName) { @@ -838,6 +841,12 @@ bool cIndexFile::CatchUp(int Index) for (int i = 0; i <= MAXINDEXCATCHUP && (Index < 0 || Index >= last); i++) { struct stat buf; if (fstat(f, &buf) == 0) { + if (time(NULL) - buf.st_mtime > MININDEXAGE) { + // apparently the index file is not being written any more + close(f); + f = -1; + return false; + } int newLast = buf.st_size / sizeof(tIndex) - 1; if (newLast > last) { if (size <= newLast) { @@ -897,7 +906,7 @@ bool cIndexFile::Get(int Index, uchar *FileNumber, int *FileOffset, uchar *Pictu { if (index) { CatchUp(Index); - if (Index >= 0 && Index <= last) { + if (Index >= 0 && Index < last) { *FileNumber = index[Index].number; *FileOffset = index[Index].offset; if (PictureType) diff --git a/svdrp.c b/svdrp.c index b59cb393..92365e72 100644 --- a/svdrp.c +++ b/svdrp.c @@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 1.39 2002/08/11 12:01:28 kls Exp $ + * $Id: svdrp.c 1.40 2002/08/25 10:40:46 kls Exp $ */ #include "svdrp.h" @@ -174,6 +174,8 @@ const char *HelpPages[] = { " Switch channel up, down or to the given channel number or name.\n" " Without option (or after successfully switching to the channel)\n" " it returns the current channel number and name.", + "CLRE\n" + " Clear the entire EPG list.", "DELC \n" " Delete channel.", "DELR \n" @@ -438,6 +440,12 @@ void cSVDRP::CmdCHAN(const char *Option) Reply(550, "Unable to find channel \"%d\"", cDevice::CurrentChannel()); } +void cSVDRP::CmdCLRE(const char *Option) +{ + cSIProcessor::Clear(); + Reply(250, "EPG data cleared"); +} + void cSVDRP::CmdDELC(const char *Option) { //TODO combine this with menu action (timers must be updated) @@ -967,6 +975,7 @@ void cSVDRP::Execute(char *Cmd) *s++ = 0; s = skipspace(s); if (CMD("CHAN")) CmdCHAN(s); + else if (CMD("CLRE")) CmdCLRE(s); else if (CMD("DELC")) CmdDELC(s); else if (CMD("DELR")) CmdDELR(s); else if (CMD("DELT")) CmdDELT(s); diff --git a/svdrp.h b/svdrp.h index 29ef83cd..879fb649 100644 --- a/svdrp.h +++ b/svdrp.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: svdrp.h 1.15 2002/03/08 16:40:23 kls Exp $ + * $Id: svdrp.h 1.16 2002/08/25 10:35:25 kls Exp $ */ #ifndef __SVDRP_H @@ -53,6 +53,7 @@ private: bool Send(const char *s, int length = -1); void Reply(int Code, const char *fmt, ...); void CmdCHAN(const char *Option); + void CmdCLRE(const char *Option); void CmdDELC(const char *Option); void CmdDELR(const char *Option); void CmdDELT(const char *Option); diff --git a/xd b/xd new file mode 100644 index 00000000..a2cff6f6 --- /dev/null +++ b/xd @@ -0,0 +1 @@ +rm x.diff