summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2003-05-18 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2003-05-18 18:00:00 +0200
commit3bd9a7ccf355e445685ff115464a4e684a8c4211 (patch)
tree8b0a44d0c40e939967c73ec6ebe18776b51c9dcb /recording.c
parentc84022554aaacc9b1c3d9627501cdbb8276871f6 (diff)
downloadvdr-patch-lnbsharing-3bd9a7ccf355e445685ff115464a4e684a8c4211.tar.gz
vdr-patch-lnbsharing-3bd9a7ccf355e445685ff115464a4e684a8c4211.tar.bz2
Version 1.1.32vdr-1.1.32
- Removed a faulty parameter initialization in menu.c (thanks to Lauri Tischler for reporting this one). - Re-implemented the WaitForPut/WaitForGet stuff in cRingBuffer, since some plugins actually need this. By default the buffer does not wait; if a plugin needs the waiting functionality it can call the new SetTimeouts() function. - Moved the call to cPlugin::Start() further up in vdr.c, to make sure it gets called before trying to learn the keys (problem reported by Oliver Endriss). - No longer starting the editing process if no marks have been set (thanks to Matthias Raus for reporting this one). - Added Catalanian language texts (thanks to Marc Rovira Vall and Ramon Roca). Plugin authors may want to add the new entries to their I18N texts and contact the translators to have their texts translated. Note that there are now 16 different OSD languages, so please make sure you have 16 versions for each of your texts. - Moved the detection of a broken video data stream from the cDevice into the cRecorder to avoid problems with cReceivers that want to receive from PIDs that are currently not transmitting (thanks to Marcel Wiesweg for reporting this one). - Fixed setting the locking pid after a timed wait (thanks to Andreas Schultz). - Avoiding spurious section filter settings after a channel switch. - Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt). - Fixed reading 'epg.data' for channels with non-zero RID (thanks to Oliver Endriss for reporting this one). - Fixed EPG bugfix statistics to avoid log entires for undefined channels (thanks to Lars Bläser for reporting this one). - No longer waiting inside cIndexFile::CatchUp() to avoid shortly blocking replay at the end of a recording.
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c90
1 files changed, 42 insertions, 48 deletions
diff --git a/recording.c b/recording.c
index 3610382..9105157 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.77 2003/05/11 13:09:08 kls Exp $
+ * $Id: recording.c 1.78 2003/05/18 15:17:45 kls Exp $
*/
#include "recording.h"
@@ -764,9 +764,6 @@ void cRecordingUserCommand::InvokeCommand(const char *State, const char *Recordi
#define INDEXFILESUFFIX "/index.vdr"
-// 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 3600 // seconds
@@ -850,50 +847,47 @@ bool cIndexFile::CatchUp(int Index)
{
// returns true unless something really goes wrong, so that 'index' becomes NULL
if (index && f >= 0) {
- 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;
- break;
- }
- int newLast = buf.st_size / sizeof(tIndex) - 1;
- if (newLast > last) {
- if (size <= newLast) {
- size *= 2;
- if (size <= newLast)
- size = newLast + 1;
- }
- index = (tIndex *)realloc(index, size * sizeof(tIndex));
- if (index) {
- int offset = (last + 1) * sizeof(tIndex);
- int delta = (newLast - last) * sizeof(tIndex);
- if (lseek(f, offset, SEEK_SET) == offset) {
- if (safe_read(f, &index[last + 1], delta) != delta) {
- esyslog("ERROR: can't read from index");
- free(index);
- index = NULL;
- close(f);
- f = -1;
- break;
- }
- last = newLast;
- }
- else
- LOG_ERROR_STR(fileName);
- }
- else
- esyslog("ERROR: can't realloc() index");
- }
- }
- else
- LOG_ERROR_STR(fileName);
- if (Index < last)
- break;
- sleep(1);
- }
+ if (Index < 0 || Index >= last) {
+ 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 true;
+ }
+ int newLast = buf.st_size / sizeof(tIndex) - 1;
+ if (newLast > last) {
+ if (size <= newLast) {
+ size *= 2;
+ if (size <= newLast)
+ size = newLast + 1;
+ }
+ index = (tIndex *)realloc(index, size * sizeof(tIndex));
+ if (index) {
+ int offset = (last + 1) * sizeof(tIndex);
+ int delta = (newLast - last) * sizeof(tIndex);
+ if (lseek(f, offset, SEEK_SET) == offset) {
+ if (safe_read(f, &index[last + 1], delta) != delta) {
+ esyslog("ERROR: can't read from index");
+ free(index);
+ index = NULL;
+ close(f);
+ f = -1;
+ return true;
+ }
+ last = newLast;
+ }
+ else
+ LOG_ERROR_STR(fileName);
+ }
+ else
+ esyslog("ERROR: can't realloc() index");
+ }
+ }
+ else
+ LOG_ERROR_STR(fileName);
+ }
}
return index != NULL;
}