summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-08-25 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2002-08-25 18:00:00 +0200
commita2a215d5e12ad35df8d0731dd00b6e41d5dd77fa (patch)
treecb13aa5088a06e52ca9ef762224ed1708e19465f /recording.c
parented643353b100bee75459c4ef2d0330e7a04e1f2a (diff)
downloadvdr-patch-lnbsharing-a2a215d5e12ad35df8d0731dd00b6e41d5dd77fa.tar.gz
vdr-patch-lnbsharing-a2a215d5e12ad35df8d0731dd00b6e41d5dd77fa.tar.bz2
Version 1.1.8vdr-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).
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/recording.c b/recording.c
index be91540..c923446 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)