diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index 0b8c4f798..330192bf0 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -478,12 +478,12 @@ bool readEventsFromXMLTV(std::string &epgname, int &ev_count) strptime(start, "%Y%m%d%H%M%S %z", &starttime); strptime(stop, "%Y%m%d%H%M%S %z", &stoptime); time_t start_time = mktime(&starttime) + starttime.tm_gmtoff; - time_t duration = mktime(&stoptime) + starttime.tm_gmtoff - start_time; + time_t duration = mktime(&stoptime) + stoptime.tm_gmtoff - start_time; t_channel_id epgid = 0; time_t current_time; time(¤t_time); - time_t time_diff = current_time - (start_time + duration); + double time_diff = difftime(current_time, start_time + duration); // just loads events if they end is in the future if (time_diff < 0)