summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-08-11 09:38:12 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-08-11 09:38:12 +0200
commit627916d32a363913f34b255b0a5dc0e89ffe9408 (patch)
tree48d643ba72e2238faa3493a79434891d111ef6c3 /eit.c
parentcf15f276f9b7b97311003d2d1dc6dcdb444feb37 (diff)
downloadvdr-627916d32a363913f34b255b0a5dc0e89ffe9408.tar.gz
vdr-627916d32a363913f34b255b0a5dc0e89ffe9408.tar.bz2
New command line option -E
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/eit.c b/eit.c
index 3de61020..50f380f2 100644
--- a/eit.c
+++ b/eit.c
@@ -13,7 +13,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: eit.c 1.16 2001/05/26 10:58:01 kls Exp $
+ * $Id: eit.c 1.17 2001/08/11 09:31:54 kls Exp $
***************************************************************************/
#include "eit.h"
@@ -1099,10 +1099,12 @@ bool cEIT::WriteExtEventDescriptor(unsigned short service, eit_loop_t *eitloop,
// --- cSIProcessor ----------------------------------------------------------
#define MAX_FILTERS 20
+#define EPGDATAFILENAME "epg.data"
int cSIProcessor::numSIProcessors = 0;
cSchedules *cSIProcessor::schedules = NULL;
cMutex cSIProcessor::schedulesMutex;
+const char *cSIProcessor::epgDataFileName = EPGDATAFILENAME;
/** */
cSIProcessor::cSIProcessor(const char *FileName)
@@ -1129,6 +1131,18 @@ cSIProcessor::~cSIProcessor()
delete fileName;
}
+void cSIProcessor::SetEpgDataFileName(const char *FileName)
+{
+ epgDataFileName = NULL;
+ if (FileName)
+ epgDataFileName = strdup(DirectoryOk(FileName) ? AddDirectory(FileName, EPGDATAFILENAME) : FileName);
+}
+
+const char *cSIProcessor::GetEpgDataFileName(void)
+{
+ return epgDataFileName ? AddDirectory(VideoDirectory, epgDataFileName) : NULL;
+}
+
void cSIProcessor::SetStatus(bool On)
{
LOCK_THREAD;
@@ -1174,16 +1188,18 @@ void cSIProcessor::Action()
schedulesMutex.Unlock();
lastCleanup = now;
}
- if (now - lastDump > 600)
+ if (epgDataFileName && now - lastDump > 600)
{
LOCK_THREAD;
schedulesMutex.Lock();
- FILE *f = fopen(AddDirectory(VideoDirectory, "epg.data"), "w");
+ FILE *f = fopen(GetEpgDataFileName(), "w");
if (f) {
schedules->Dump(f);
fclose(f);
}
+ else
+ LOG_ERROR;
lastDump = now;
schedulesMutex.Unlock();
}