fix typo, use function for time diff

Origin commit data
------------------
Commit: d7795f2ba6
Author: TangoCash <eric@loxat.de>
Date: 2018-10-28 (Sun, 28 Oct 2018)
This commit is contained in:
TangoCash
2018-10-28 13:06:12 +01:00
committed by vanhofen
parent 1b88257ce4
commit 78e6e1a805

View File

@@ -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(&current_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)