diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-08-11 09:38:12 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-08-11 09:38:12 +0200 |
commit | 627916d32a363913f34b255b0a5dc0e89ffe9408 (patch) | |
tree | 48d643ba72e2238faa3493a79434891d111ef6c3 /eit.c | |
parent | cf15f276f9b7b97311003d2d1dc6dcdb444feb37 (diff) | |
download | vdr-627916d32a363913f34b255b0a5dc0e89ffe9408.tar.gz vdr-627916d32a363913f34b255b0a5dc0e89ffe9408.tar.bz2 |
New command line option -E
Diffstat (limited to 'eit.c')
-rw-r--r-- | eit.c | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -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(); } |