Sets tm_isdst to -1. This makes dvb_time available outside of EIT parsing, and struct tm to reflect the actual values received from DVB. Also fixes indentation. Signed-off-by: André Roth <neolynx@xxxxxxxxx> --- lib/libdvbv5/tables/eit.c | 49 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/lib/libdvbv5/tables/eit.c b/lib/libdvbv5/tables/eit.c index a6ba566a..40db637a 100644 --- a/lib/libdvbv5/tables/eit.c +++ b/lib/libdvbv5/tables/eit.c @@ -156,33 +156,32 @@ void dvb_table_eit_print(struct dvb_v5_fe_parms *parms, struct dvb_table_eit *ei void dvb_time(const uint8_t data[5], struct tm *tm) { - /* ETSI EN 300 468 V1.4.1 */ - int year, month, day, hour, min, sec; - int k = 0; - uint16_t mjd; - - mjd = *(uint16_t *) data; - hour = dvb_bcd(data[2]); - min = dvb_bcd(data[3]); - sec = dvb_bcd(data[4]); - year = ((mjd - 15078.2) / 365.25); - month = ((mjd - 14956.1 - (int) (year * 365.25)) / 30.6001); - day = mjd - 14956 - (int) (year * 365.25) - (int) (month * 30.6001); - if (month == 14 || month == 15) k = 1; - year += k; - month = month - 1 - k * 12; - - tm->tm_sec = sec; - tm->tm_min = min; - tm->tm_hour = hour; - tm->tm_mday = day; - tm->tm_mon = month - 1; - tm->tm_year = year; - tm->tm_isdst = 1; /* dst in effect, do not adjust */ - mktime( tm ); + /* ETSI EN 300 468 V1.4.1 */ + int year, month, day, hour, min, sec; + int k = 0; + uint16_t mjd; + + mjd = *(uint16_t *) data; + hour = dvb_bcd(data[2]); + min = dvb_bcd(data[3]); + sec = dvb_bcd(data[4]); + year = ((mjd - 15078.2) / 365.25); + month = ((mjd - 14956.1 - (int) (year * 365.25)) / 30.6001); + day = mjd - 14956 - (int) (year * 365.25) - (int) (month * 30.6001); + if (month == 14 || month == 15) k = 1; + year += k; + month = month - 1 - k * 12; + + tm->tm_sec = sec; + tm->tm_min = min; + tm->tm_hour = hour; + tm->tm_mday = day; + tm->tm_mon = month - 1; + tm->tm_year = year; + tm->tm_isdst = -1; /* do not adjust */ + mktime( tm ); } - const char *dvb_eit_running_status_name[8] = { [0] = "Undefined", [1] = "Not running", -- 2.17.1