1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed cleaning up old EPG events in case no epg data file is given

This commit is contained in:
Klaus Schmidinger 2013-09-01 09:20:07 +02:00
parent c3a3b70fa0
commit c169e20141
3 changed files with 15 additions and 9 deletions

View File

@ -2957,6 +2957,7 @@ Johan Andersson <jna@jna.pp.se>
Dave Pickles <dave@pickles.me.uk> Dave Pickles <dave@pickles.me.uk>
for adding support for "content identifier descriptor" and "default authority for adding support for "content identifier descriptor" and "default authority
descriptor" to 'libsi' descriptor" to 'libsi'
for reporting that old EPG events are not cleaned up in case no epg data file is given
Holger Dengler <holger.dengler@gmx.de> Holger Dengler <holger.dengler@gmx.de>
for making the isnumber() function check the given pointer for NULL for making the isnumber() function check the given pointer for NULL

View File

@ -7813,7 +7813,7 @@ Video Disk Recorder Revision History
- Fixed a crash in the LCARS skin's main menu in case there is no current channel - Fixed a crash in the LCARS skin's main menu in case there is no current channel
(reported by Dominique Dumont). (reported by Dominique Dumont).
2013-08-23: Version 2.0.3 2013-09-01: Version 2.0.3
- Fixed asserting free disk space in the cutter. - Fixed asserting free disk space in the cutter.
- No longer trying to delete old recordings in AssertFreeDiskSpace() if the given - No longer trying to delete old recordings in AssertFreeDiskSpace() if the given
@ -7829,3 +7829,5 @@ Video Disk Recorder Revision History
- All bonded devices (except for the master) now turn off their LNB power completely - All bonded devices (except for the master) now turn off their LNB power completely
to avoid problems when receiving vertically polarized transponders (suggested by to avoid problems when receiving vertically polarized transponders (suggested by
Manfred Völkel and Oliver Endriss). Manfred Völkel and Oliver Endriss).
- Fixed cleaning up old EPG events in case no epg data file is given (reported by
Dave Pickles).

19
epg.c
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* *
* $Id: epg.c 2.23 2013/02/17 14:12:07 kls Exp $ * $Id: epg.c 2.23.1.1 2013/09/01 09:16:53 kls Exp $
*/ */
#include "epg.h" #include "epg.h"
@ -1140,16 +1140,19 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules)
class cEpgDataWriter : public cThread { class cEpgDataWriter : public cThread {
private: private:
cMutex mutex; cMutex mutex;
bool dump;
protected: protected:
virtual void Action(void); virtual void Action(void);
public: public:
cEpgDataWriter(void); cEpgDataWriter(void);
void SetDump(bool Dump) { dump = Dump; }
void Perform(void); void Perform(void);
}; };
cEpgDataWriter::cEpgDataWriter(void) cEpgDataWriter::cEpgDataWriter(void)
:cThread("epg data writer", true) :cThread("epg data writer", true)
{ {
dump = false;
} }
void cEpgDataWriter::Action(void) void cEpgDataWriter::Action(void)
@ -1169,7 +1172,8 @@ void cEpgDataWriter::Perform(void)
p->Cleanup(now); p->Cleanup(now);
} }
} }
cSchedules::Dump(); if (dump)
cSchedules::Dump();
} }
static cEpgDataWriter EpgDataWriter; static cEpgDataWriter EpgDataWriter;
@ -1203,6 +1207,7 @@ void cSchedules::SetEpgDataFileName(const char *FileName)
{ {
free(epgDataFileName); free(epgDataFileName);
epgDataFileName = FileName ? strdup(FileName) : NULL; epgDataFileName = FileName ? strdup(FileName) : NULL;
EpgDataWriter.SetDump(epgDataFileName != NULL);
} }
void cSchedules::SetModified(cSchedule *Schedule) void cSchedules::SetModified(cSchedule *Schedule)
@ -1217,12 +1222,10 @@ void cSchedules::Cleanup(bool Force)
lastDump = 0; lastDump = 0;
time_t now = time(NULL); time_t now = time(NULL);
if (now - lastDump > EPGDATAWRITEDELTA) { if (now - lastDump > EPGDATAWRITEDELTA) {
if (epgDataFileName) { if (Force)
if (Force) EpgDataWriter.Perform();
EpgDataWriter.Perform(); else if (!EpgDataWriter.Active())
else if (!EpgDataWriter.Active()) EpgDataWriter.Start();
EpgDataWriter.Start();
}
lastDump = now; lastDump = now;
} }
} }