diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-03-07 11:53:43 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-03-07 11:53:43 +0100 |
commit | 2dc3a3d399f7315df034c13fc63dc097683f1f97 (patch) | |
tree | b878d1a80ca1eb065e1ba41ab9d5a155fd3f9ceb /eit.c | |
parent | 823081b59e4fe6e54b547c13e65df31504b7d418 (diff) | |
download | vdr-2dc3a3d399f7315df034c13fc63dc097683f1f97.tar.gz vdr-2dc3a3d399f7315df034c13fc63dc097683f1f97.tar.bz2 |
Fixed handling VPS times at year boundaries
Diffstat (limited to 'eit.c')
-rw-r--r-- | eit.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -8,7 +8,7 @@ * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>. * - * $Id: eit.c 1.91 2004/03/07 10:36:57 kls Exp $ + * $Id: eit.c 1.92 2004/03/07 11:51:57 kls Exp $ */ #include "eit.h" @@ -126,11 +126,16 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data) struct tm tm_r; struct tm t = *localtime_r(&now, &tm_r); // this initializes the time zone in 't' t.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting + int month = t.tm_mon; t.tm_mon = pd->getMonth() - 1; t.tm_mday = pd->getDay(); t.tm_hour = pd->getHour(); t.tm_min = pd->getMinute(); t.tm_sec = 0; + if (month == 11 && t.tm_mon == 0) // current month is dec, but event is in jan + t.tm_year++; + else if (month == 0 && t.tm_mon == 11) // current month is jan, but event is in dec + t.tm_year--; time_t vps = mktime(&t); pEvent->SetVps(vps); } |