From 1595890438d5b6e7d7ba73f7cafddf488236a211 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Thu, 18 Aug 2022 14:28:31 +0000 Subject: [PATCH] Fix some times being 1h out Recordings start times not in the current timezone would be displayed as if they were. Caused by MVP legacy code. --- src/vdr.cc | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/vdr.cc b/src/vdr.cc index 05a651b..fbb7070 100644 --- a/src/vdr.cc +++ b/src/vdr.cc @@ -683,37 +683,40 @@ bool VDR::doLogin(unsigned int* v_server_min, unsigned int* v_server_max, unsign // Set the time and zone on the MVP only #if !defined(WIN32) && !defined(__ANDROID__) + + /* FIXME make this a config option struct timespec currentTime; currentTime.tv_sec = vdrTime; currentTime.tv_nsec = 0; - int b = clock_settime(CLOCK_REALTIME, ¤tTime); - logger->debug(TAG, "set clock = {}", b); + */ - // now make a TZ variable and set it - char sign; - int hours; - int minutes; - if (vdrTimeOffset > 0) sign = '-'; - else sign = '+'; + /* Obsolete + // now make a TZ variable and set it + char sign; + int hours; + int minutes; + if (vdrTimeOffset > 0) sign = '-'; + else sign = '+'; - vdrTimeOffset = abs(vdrTimeOffset); + vdrTimeOffset = abs(vdrTimeOffset); - hours = (int)vdrTimeOffset / 3600; - minutes = vdrTimeOffset % 3600; + hours = (int)vdrTimeOffset / 3600; + minutes = vdrTimeOffset % 3600; - logger->debug(TAG, "{} {} {}", sign, hours, minutes); + logger->debug(TAG, "{} {} {}", sign, hours, minutes); - minutes = (int)minutes / 60; + minutes = (int)minutes / 60; - logger->debug(TAG, "{} {} {}", sign, hours, minutes); + logger->debug(TAG, "{} {} {}", sign, hours, minutes); - char newTZ[30]; - sprintf(newTZ, "MVP%c%i:%i", sign, hours, minutes); - setenv("TZ", newTZ, 1); + char newTZ[30]; + sprintf(newTZ, "MVP%c%i:%i", sign, hours, minutes); + setenv("TZ", newTZ, 1); - logger->debug(TAG, "Timezone data: {}", newTZ); + logger->debug(TAG, "Timezone data: {}", newTZ); + */ #endif setCharset(Osd::getInstance()->charSet()); -- 2.39.5