summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-08-31 13:21:09 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2013-08-31 13:21:09 +0200
commitb931724b7554ba55c4ea8a36329a826763fe8453 (patch)
tree84351fd97f2a333d933bb4360d00d1dae94d6041
parentbd6da13a67cd95b0c57d6e85152dfcaa1372ad8a (diff)
downloadvdr-b931724b7554ba55c4ea8a36329a826763fe8453.tar.gz
vdr-b931724b7554ba55c4ea8a36329a826763fe8453.tar.bz2
Fixed cleaning up old EPG events in case no epg data file is given
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY2
-rw-r--r--epg.c19
3 files changed, 14 insertions, 8 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 39aa55fc..4a8eb604 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -2965,6 +2965,7 @@ Johan Andersson <jna@jna.pp.se>
Dave Pickles <dave@pickles.me.uk>
for adding support for "content identifier descriptor" and "default authority
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>
for making the isnumber() function check the given pointer for NULL
diff --git a/HISTORY b/HISTORY
index 849e23c5..5b352dbc 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7917,3 +7917,5 @@ Video Disk Recorder Revision History
character was always skipped).
- Fixed wrong initialization of Setup.PositionerSwing (reported by Arthur Konovalov).
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
+- Fixed cleaning up old EPG events in case no epg data file is given (reported by
+ Dave Pickles).
diff --git a/epg.c b/epg.c
index e16f9780..ee784219 100644
--- a/epg.c
+++ b/epg.c
@@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 3.1 2013/08/23 10:46:33 kls Exp $
+ * $Id: epg.c 3.2 2013/08/31 13:21:09 kls Exp $
*/
#include "epg.h"
@@ -1140,16 +1140,19 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules)
class cEpgDataWriter : public cThread {
private:
cMutex mutex;
+ bool dump;
protected:
virtual void Action(void);
public:
cEpgDataWriter(void);
+ void SetDump(bool Dump) { dump = Dump; }
void Perform(void);
};
cEpgDataWriter::cEpgDataWriter(void)
:cThread("epg data writer", true)
{
+ dump = false;
}
void cEpgDataWriter::Action(void)
@@ -1169,7 +1172,8 @@ void cEpgDataWriter::Perform(void)
p->Cleanup(now);
}
}
- cSchedules::Dump();
+ if (dump)
+ cSchedules::Dump();
}
static cEpgDataWriter EpgDataWriter;
@@ -1203,6 +1207,7 @@ void cSchedules::SetEpgDataFileName(const char *FileName)
{
free(epgDataFileName);
epgDataFileName = FileName ? strdup(FileName) : NULL;
+ EpgDataWriter.SetDump(epgDataFileName != NULL);
}
void cSchedules::SetModified(cSchedule *Schedule)
@@ -1217,12 +1222,10 @@ void cSchedules::Cleanup(bool Force)
lastDump = 0;
time_t now = time(NULL);
if (now - lastDump > EPGDATAWRITEDELTA) {
- if (epgDataFileName) {
- if (Force)
- EpgDataWriter.Perform();
- else if (!EpgDataWriter.Active())
- EpgDataWriter.Start();
- }
+ if (Force)
+ EpgDataWriter.Perform();
+ else if (!EpgDataWriter.Active())
+ EpgDataWriter.Start();
lastDump = now;
}
}