[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#988611: unblock: kodi/2:19.1+dfsg1-1



Package: release.debian.org
Followup-For: Bug #988611
X-Debbugs-Cc: sramacher@respighi.debian.org, sramacher@debian.org, mattia@debian.org

Control: retitle -1 unblock: kodi/2:19.0+dfsg1-2

Hi Sebastian,

I prepared 2:19.0+dfsg1-2 fixing only bugs reported to Debian.
Debdiff against 2:19.0+dfsg1-1 attached.

As I wrote in the private message to you earlier this week, I don't want to take
responsibility from the Kodi upstream and cherry-pick only some bugfixes that might
be considered "important" from my PoV. This creates an inconsistent user experience
across vanilla Kodi and Kodi from Debian, plus requires me to spend even more time
carefully testing each combination of cherry-picked commits in addition to all the
time I already spent fixing a lot of stuff upstream and in Debian.

The Kodi upstream has an estabilished testing and backport culture, and it is not that
easy to slip a risky change into a stable branch (which 19.x currently is). Plus all
upstream changes must pass CI before getting merged.

If it is not possible to have 19.x point (bugfix) releases in bullseye, I think
I will upload next point releases to experimental during the bullseye freeze,
then to bullseye-backports after bookworm development cycle starts. And for stable
branch I will port only CVE fixes and bug fixes reported to Debian.

Regards,
Vasyl
diff -Nru kodi-19.0+dfsg1/debian/changelog kodi-19.0+dfsg1/debian/changelog
--- kodi-19.0+dfsg1/debian/changelog	2021-02-19 00:02:45.000000000 +0000
+++ kodi-19.0+dfsg1/debian/changelog	2021-05-30 04:57:39.000000000 +0000
@@ -1,3 +1,13 @@
+kodi (2:19.0+dfsg1-2) unstable; urgency=medium
+
+  * Add missing font dependency (Closes: #985497)
+  * Fix github ref
+  * Branch out bullseye
+  * Refresh cdatetime-std-chrono patch (Closes: #984682)
+  * libdate-tz: Fix crash for early local times and USE_OS_TZDB
+
+ -- Vasyl Gello <vasek.gello@gmail.com>  Sun, 30 May 2021 04:57:39 +0000
+
 kodi (2:19.0+dfsg1-1) unstable; urgency=medium
 
   * New upstream version 19.0+dfsg1
diff -Nru kodi-19.0+dfsg1/debian/control kodi-19.0+dfsg1/debian/control
--- kodi-19.0+dfsg1/debian/control	2021-02-19 00:02:45.000000000 +0000
+++ kodi-19.0+dfsg1/debian/control	2021-05-30 04:57:39.000000000 +0000
@@ -107,7 +107,7 @@
 Standards-Version: 4.5.1
 Rules-Requires-Root: no
 Vcs-Browser: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi
-Vcs-Git: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi.git
+Vcs-Git: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi.git -b bullseye
 Homepage: https://kodi.tv/
 
 Package: kodi
@@ -154,6 +154,7 @@
          ${misc:Depends}
 Recommends: fonts-noto-hinted,
             fonts-noto-mono,
+            fonts-roboto-hinted,
             fonts-roboto-unhinted
 Breaks: xbmc (<< 2:13.2+dfsg1-5~)
 Replaces: xbmc (<< 2:13.2+dfsg1-5~)
diff -Nru kodi-19.0+dfsg1/debian/gbp.conf kodi-19.0+dfsg1/debian/gbp.conf
--- kodi-19.0+dfsg1/debian/gbp.conf	2021-02-19 00:02:45.000000000 +0000
+++ kodi-19.0+dfsg1/debian/gbp.conf	2021-05-30 04:57:39.000000000 +0000
@@ -3,3 +3,4 @@
 [DEFAULT]
 filter = */.git*
 components = ["libdate-tz-embedded", "libdvdnav-embedded", "libdvdread-embedded"]
+debian-branch = bullseye
diff -Nru kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0001-Replace-Kodi-date-time-implementation-with-std-c.patch kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0001-Replace-Kodi-date-time-implementation-with-std-c.patch
--- kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0001-Replace-Kodi-date-time-implementation-with-std-c.patch	2021-02-19 00:02:45.000000000 +0000
+++ kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0001-Replace-Kodi-date-time-implementation-with-std-c.patch	2021-05-30 04:57:39.000000000 +0000
@@ -1,7 +1,7 @@
-From 60adbc26eafaa4edd136f4f515cf494b62f24f4f Mon Sep 17 00:00:00 2001
+From e7e426ec1b8f22dfc0c24cdf7a8a4476920128e4 Mon Sep 17 00:00:00 2001
 From: Lukas Rusak <lorusak@gmail.com>
 Date: Mon, 17 Feb 2020 22:41:25 -0800
-Subject: [PATCH 01/13] [cmake] add support for date library and tzdata
+Subject: [PATCH 01/17] [cmake] add support for date library and tzdata
 
 ---
  CMakeLists.txt               |  2 +
@@ -10,10 +10,10 @@
  create mode 100644 cmake/modules/FindDate.cmake
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index e30083d2f9..dbdaf3ee0e 100644
+index 572e99b481..e49e743fbd 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -64,6 +64,7 @@ if(UNIX)
+@@ -68,6 +68,7 @@ if(UNIX)
    option(ENABLE_INTERNAL_GTEST "Enable internal gtest?" OFF)
    option(ENABLE_INTERNAL_UDFREAD "Enable internal udfread?" OFF)
    option(ENABLE_INTERNAL_SPDLOG "Enable internal spdlog?" OFF)
@@ -21,7 +21,7 @@
  endif()
  # System options
  if(NOT WIN32)
-@@ -121,6 +122,7 @@ set(required_deps ASS
+@@ -125,6 +126,7 @@ set(required_deps ASS
                    Cdio
                    CrossGUID
                    Curl
@@ -128,13 +128,13 @@
 +
 +list(APPEND GLOBAL_TARGET_DEPS tzdata)
 -- 
-2.30.0
+2.31.1
 
 
-From 91d5009265d14b958abf70980f5c14dd76df0363 Mon Sep 17 00:00:00 2001
+From a15c159e4b19919775104f23eeed0c62b6368ff3 Mon Sep 17 00:00:00 2001
 From: Lukas Rusak <lorusak@gmail.com>
 Date: Tue, 17 Mar 2020 13:12:04 -0700
-Subject: [PATCH 02/13] add resource.timezone
+Subject: [PATCH 02/17] add resource.timezone
 
 ---
  addons/kodi.resource/addon.xml      |  1 +
@@ -230,7 +230,7 @@
    <addon>screensaver.xbmc.builtin.black</addon>
    <addon>screensaver.xbmc.builtin.dim</addon>
 diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
-index daf96d7be1..c8d8cf9321 100644
+index 5f25fcc9eb..e57a1d63d7 100644
 --- a/xbmc/Application.cpp
 +++ b/xbmc/Application.cpp
 @@ -200,6 +200,10 @@
@@ -403,13 +403,13 @@
    ADDON_RESOURCE_GAMES,
    ADDON_RESOURCE_FONT,
 -- 
-2.30.0
+2.31.1
 
 
-From ed5a56c5e98885367a3f439e9ff89b26afc142f3 Mon Sep 17 00:00:00 2001
+From 0f586aef328504fb81cabe9b1ea9b7cc77116aab Mon Sep 17 00:00:00 2001
 From: Lukas Rusak <lorusak@gmail.com>
 Date: Mon, 10 Feb 2020 15:13:43 -0800
-Subject: [PATCH 03/13] CDateTime: convert to use std::chrono
+Subject: [PATCH 03/17] CDateTime: convert to use std::chrono
 
 ---
  xbmc/XBDateTime.cpp                   | 605 ++++++++++----------------
@@ -1575,10 +1575,10 @@
  
  std::vector<std::string> CPosixTimezone::GetCounties()
 diff --git a/xbmc/pvr/guilib/PVRGUIActions.cpp b/xbmc/pvr/guilib/PVRGUIActions.cpp
-index d5d3e1fb1d..f675f780cc 100644
+index 69f181c907..38e31f459a 100644
 --- a/xbmc/pvr/guilib/PVRGUIActions.cpp
 +++ b/xbmc/pvr/guilib/PVRGUIActions.cpp
-@@ -1721,10 +1721,7 @@ namespace PVR
+@@ -1722,10 +1722,7 @@ namespace PVR
          return false;
      }
  
@@ -1591,13 +1591,13 @@
      pDlgProgress->SetHeading(CVariant{313}); // "Cleaning database"
      pDlgProgress->SetLine(0, CVariant{g_localizeStrings.Get(19187)}); // "Clearing all related data."
 -- 
-2.30.0
+2.31.1
 
 
-From 6f76b0a0d912b1816bc94d5984accb8ec5c641a0 Mon Sep 17 00:00:00 2001
+From e52da9238a0bc7f3ed490900d727a9576182a44d Mon Sep 17 00:00:00 2001
 From: Lukas Rusak <lorusak@gmail.com>
 Date: Mon, 17 Feb 2020 22:40:56 -0800
-Subject: [PATCH 04/13] [test] fix TestDateTime to work with std::chrono
+Subject: [PATCH 04/17] [test] fix TestDateTime to work with std::chrono
 
 ---
  xbmc/test/TestDateTime.cpp | 89 ++++++++------------------------------
@@ -1805,13 +1805,13 @@
    EXPECT_EQ(dateTime.GetDay(), 1);
    EXPECT_EQ(dateTime.GetHour(), 0);
 -- 
-2.30.0
+2.31.1
 
 
-From 9abc1b26dfa19b9dc27eefbcf42b0d9bb6d90fc5 Mon Sep 17 00:00:00 2001
+From 758c5404a7ad96f6b28a8e046b58615c14daa954 Mon Sep 17 00:00:00 2001
 From: Lukas Rusak <lorusak@gmail.com>
 Date: Thu, 10 Sep 2020 08:19:35 -0700
-Subject: [PATCH 05/13] [WIP] cleanup CPosixTimezone
+Subject: [PATCH 05/17] [WIP] cleanup CPosixTimezone
 
 ---
  xbmc/Application.cpp                  |   4 +
@@ -1820,7 +1820,7 @@
  3 files changed, 117 insertions(+), 173 deletions(-)
 
 diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
-index c8d8cf9321..ecbc4fb669 100644
+index e57a1d63d7..deedb7bccd 100644
 --- a/xbmc/Application.cpp
 +++ b/xbmc/Application.cpp
 @@ -344,6 +344,8 @@ void CApplication::Preflight()
@@ -2222,13 +2222,13 @@
     std::map<std::string, std::string> m_countryByName;
  
 -- 
-2.30.0
+2.31.1
 
 
-From e6073bc3b3e267188347706e9dd60543f904c0de Mon Sep 17 00:00:00 2001
+From 5bd621db4e7ea2bcc0f3ce631ad34321535f1144 Mon Sep 17 00:00:00 2001
 From: Lukas Rusak <lorusak@gmail.com>
 Date: Thu, 10 Sep 2020 08:41:57 -0700
-Subject: [PATCH 06/13] utils/XTimeUtils: clean up SystemTime and FileTime
+Subject: [PATCH 06/17] utils/XTimeUtils: clean up SystemTime and FileTime
  functions
 
 ---
@@ -3379,10 +3379,10 @@
                value = emptyString;
            }
 diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp
-index 72913b66b0..e1b19b9e7c 100644
+index 13859b3bdb..3638870a79 100644
 --- a/xbmc/music/infoscanner/MusicInfoScanner.cpp
 +++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp
-@@ -1246,8 +1246,8 @@ int CMusicInfoScanner::GetPathHash(const CFileItemList &items, std::string &hash
+@@ -1263,8 +1263,8 @@ int CMusicInfoScanner::GetPathHash(const CFileItemList &items, std::string &hash
      const CFileItemPtr pItem = items[i];
      digest.Update(pItem->GetPath());
      digest.Update((unsigned char *)&pItem->m_dwSize, sizeof(pItem->m_dwSize));
@@ -3730,7 +3730,7 @@
            pItem->SetProperty("file:hidden", true);
          items.Add(pItem);
 diff --git a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
-index c328b22d4b..40bfa54a4e 100644
+index 49e1d65ad2..3be889ab3d 100644
 --- a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
 +++ b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
 @@ -506,22 +506,16 @@ void CGUIDialogPVRTimerSettings::OnSettingAction(const std::shared_ptr<const CSe
@@ -3758,7 +3758,7 @@
        m_timerEndTimeStr = m_endLocalTime.GetAsLocalizedTime("", false);
        SetButtonLabels();
      }
-@@ -726,15 +720,6 @@ void CGUIDialogPVRTimerSettings::SetDateFromIndex(CDateTime& datetime, int date)
+@@ -727,15 +721,6 @@ void CGUIDialogPVRTimerSettings::SetDateFromIndex(CDateTime& datetime, int date)
      datetime.GetHour(), datetime.GetMinute(), datetime.GetSecond());
  }
  
@@ -3787,10 +3787,10 @@
      static int GetWeekdaysFromSetting(const std::shared_ptr<const CSetting>& setting);
  
 diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
-index 67805e6bae..9e815946fb 100644
+index 2f06ed7303..89aa247205 100644
 --- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
 +++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
-@@ -732,13 +732,12 @@ bool CGUIWindowPVRGuideBase::OpenDateSelectionDialog()
+@@ -762,13 +762,12 @@ bool CGUIWindowPVRGuideBase::OpenDateSelectionDialog()
  {
    bool bReturn = false;
  
@@ -4180,13 +4180,13 @@
        if (pItem->IsVideo() && !pItem->IsPlayList() && !pItem->IsNFO())
          count++;
 -- 
-2.30.0
+2.31.1
 
 
-From da1f29dfad2f26613e0606213658ccfb0d0c6887 Mon Sep 17 00:00:00 2001
+From a5f566c603a4440df292e0488861bc0ebc2974ea Mon Sep 17 00:00:00 2001
 From: Vasyl Gello <vasek.gello@gmail.com>
 Date: Tue, 20 Oct 2020 09:23:44 +0300
-Subject: [PATCH 07/13] SMBDirectory.cpp: Fix compile error
+Subject: [PATCH 07/17] SMBDirectory.cpp: Fix compile error
 
 ---
  xbmc/platform/posix/filesystem/SMBDirectory.cpp | 2 +-
@@ -4213,13 +4213,13 @@
          {
            // make sure we use the authenticated path wich contains any default username
 -- 
-2.30.0
+2.31.1
 
 
-From 8e72ec1c09e0dcac213d9e822a0055929478a39d Mon Sep 17 00:00:00 2001
+From 0ad7e997a335175e501405201a6f109eaa161425 Mon Sep 17 00:00:00 2001
 From: Vasyl Gello <vasek.gello@gmail.com>
 Date: Wed, 21 Oct 2020 09:17:33 +0300
-Subject: [PATCH 08/13] TestDateTime: fix GetAsStringsWithBias and add Tzdata
+Subject: [PATCH 08/17] TestDateTime: fix GetAsStringsWithBias and add Tzdata
  tests
 
 The 'GetAsStringsWithBias' test logic assumed the timezone on
@@ -4410,13 +4410,13 @@
 +  EXPECT_EQ(date::format("%FT%T%Ez", zone), "1991-05-15T02:34:56+14:00") << "tzdata information not valid for 'Etc/GMT-14'";
 +}
 -- 
-2.30.0
+2.31.1
 
 
-From 055f1523f9fe7379bd09de98193966da15a423e4 Mon Sep 17 00:00:00 2001
+From 9833e4eaa0a9b64e033b5e5d9a76a3201d81e947 Mon Sep 17 00:00:00 2001
 From: Vasyl Gello <vasek.gello@gmail.com>
 Date: Wed, 21 Oct 2020 12:41:17 +0300
-Subject: [PATCH 09/13] CDateTime: fix DateTimeSpan arithmetics typo
+Subject: [PATCH 09/17] CDateTime: fix DateTimeSpan arithmetics typo
 
 ---
  xbmc/XBDateTime.cpp | 4 ++--
@@ -4445,13 +4445,13 @@
    return left;
  }
 -- 
-2.30.0
+2.31.1
 
 
-From c416094fe6947c0492486c320790fc0df53ff333 Mon Sep 17 00:00:00 2001
+From e399fd2ca31c5d71ef6e69e8a3ca327c02e5fcaa Mon Sep 17 00:00:00 2001
 From: Vasyl Gello <vasek.gello@gmail.com>
 Date: Tue, 3 Nov 2020 17:51:26 +0200
-Subject: [PATCH 10/13] Remove GetAsUTCDateTime and add GetAsLocalDateTime
+Subject: [PATCH 10/17] Remove GetAsUTCDateTime and add GetAsLocalDateTime
 
 The 'm_time' now represents a UTC time-point, so 'GetAsUTCDateTime'
 does nothing useful. Remove it fully, and add 'GetAsLocalDateTime'
@@ -4509,10 +4509,10 @@
    std::string GetAsDBDateTime() const;
    std::string GetAsDBDate() const;
 diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp
-index b920ac1f15..18ad9d1712 100644
+index c9eae2269a..31f6b2913a 100644
 --- a/xbmc/network/WebServer.cpp
 +++ b/xbmc/network/WebServer.cpp
-@@ -233,7 +233,7 @@ MHD_RESULT CWebServer::HandlePartialRequest(struct MHD_Connection* connection,
+@@ -228,7 +228,7 @@ MHD_RESULT CWebServer::HandlePartialRequest(struct MHD_Connection* connection,
              CDateTime ifUnmodifiedSinceDate;
              // handle If-Modified-Since (but only if the response is cacheable)
              if (cacheable && ifModifiedSinceDate.SetFromRFC1123DateTime(ifModifiedSince) &&
@@ -4521,7 +4521,7 @@
              {
                struct MHD_Response* response = create_response(0, nullptr, MHD_NO, MHD_NO);
                if (response == nullptr)
-@@ -246,7 +246,7 @@ MHD_RESULT CWebServer::HandlePartialRequest(struct MHD_Connection* connection,
+@@ -241,7 +241,7 @@ MHD_RESULT CWebServer::HandlePartialRequest(struct MHD_Connection* connection,
              }
              // handle If-Unmodified-Since
              else if (ifUnmodifiedSinceDate.SetFromRFC1123DateTime(ifUnmodifiedSince) &&
@@ -4530,7 +4530,7 @@
                return SendErrorResponse(request, MHD_HTTP_PRECONDITION_FAILED, request.method);
            }
  
-@@ -520,7 +520,7 @@ bool CWebServer::IsRequestRanged(const HTTPRequest& request, const CDateTime& la
+@@ -515,7 +515,7 @@ bool CWebServer::IsRequestRanged(const HTTPRequest& request, const CDateTime& la
  
        // check if the last modification is newer than the If-Range date
        // if so we have to server the whole file instead
@@ -4605,10 +4605,10 @@
  
      /* pvr tags always start on the full minute */
 diff --git a/xbmc/pvr/epg/EpgInfoTag.cpp b/xbmc/pvr/epg/EpgInfoTag.cpp
-index f288f45b79..d732ac6039 100644
+index 74ce5e4f3f..8132b3cb6e 100644
 --- a/xbmc/pvr/epg/EpgInfoTag.cpp
 +++ b/xbmc/pvr/epg/EpgInfoTag.cpp
-@@ -223,7 +223,7 @@ float CPVREpgInfoTag::ProgressPercentage() const
+@@ -219,7 +219,7 @@ float CPVREpgInfoTag::ProgressPercentage() const
    float fReturn = 0.0f;
  
    time_t currentTime, startTime, endTime;
@@ -4617,7 +4617,7 @@
    m_startTime.GetAsTime(startTime);
    m_endTime.GetAsTime(endTime);
    int iDuration = endTime - startTime > 0 ? endTime - startTime : 3600;
-@@ -239,7 +239,7 @@ float CPVREpgInfoTag::ProgressPercentage() const
+@@ -235,7 +235,7 @@ float CPVREpgInfoTag::ProgressPercentage() const
  int CPVREpgInfoTag::Progress() const
  {
    time_t currentTime, startTime;
@@ -4627,10 +4627,10 @@
    int iDuration = currentTime - startTime;
  
 diff --git a/xbmc/pvr/guilib/PVRGUIActions.cpp b/xbmc/pvr/guilib/PVRGUIActions.cpp
-index f675f780cc..135125e59c 100644
+index 38e31f459a..c8909fc856 100644
 --- a/xbmc/pvr/guilib/PVRGUIActions.cpp
 +++ b/xbmc/pvr/guilib/PVRGUIActions.cpp
-@@ -1907,7 +1907,6 @@ namespace PVR
+@@ -1908,7 +1908,6 @@ namespace PVR
  
              CDateTime dailywakeuptime;
              dailywakeuptime.SetFromDBTime(m_settings.GetStringValue(CSettings::SETTING_PVRPOWERMANAGEMENT_DAILYWAKEUPTIME));
@@ -4664,10 +4664,10 @@
      dailywakeuptime.SetDateTime(
        now.GetYear(), now.GetMonth(), now.GetDay(),
 diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
-index 9e815946fb..a114479063 100644
+index 89aa247205..0a0ce3d492 100644
 --- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
 +++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp
-@@ -664,7 +664,7 @@ bool CGUIWindowPVRGuideBase::RefreshTimelineItems()
+@@ -679,7 +679,7 @@ bool CGUIWindowPVRGuideBase::RefreshTimelineItems()
  
        CDateTime startDate(group->GetFirstEPGDate());
        CDateTime endDate(group->GetLastEPGDate());
@@ -4710,13 +4710,13 @@
  
  TEST_F(TestDateTime, Reset)
 -- 
-2.30.0
+2.31.1
 
 
-From 3bd37b2ee91bcf5f48644a5dd0f25cf752cfb6d8 Mon Sep 17 00:00:00 2001
+From 7777a33c71d47685f2770eb5e6fd14b1278efdf0 Mon Sep 17 00:00:00 2001
 From: Vasyl Gello <vasek.gello@gmail.com>
 Date: Tue, 3 Nov 2020 22:49:09 +0200
-Subject: [PATCH 11/13] Compensate the representation change
+Subject: [PATCH 11/17] Compensate the representation change
 
 ... from local time by default to UTC time by default.
 
@@ -4736,10 +4736,10 @@
  5 files changed, 12 insertions(+), 16 deletions(-)
 
 diff --git a/xbmc/pvr/epg/EpgInfoTag.cpp b/xbmc/pvr/epg/EpgInfoTag.cpp
-index d732ac6039..1de4b11ffb 100644
+index 8132b3cb6e..7b48fc7197 100644
 --- a/xbmc/pvr/epg/EpgInfoTag.cpp
 +++ b/xbmc/pvr/epg/EpgInfoTag.cpp
-@@ -277,9 +277,7 @@ CDateTime CPVREpgInfoTag::StartAsUTC() const
+@@ -273,9 +273,7 @@ CDateTime CPVREpgInfoTag::StartAsUTC() const
  
  CDateTime CPVREpgInfoTag::StartAsLocalTime() const
  {
@@ -4750,7 +4750,7 @@
  }
  
  CDateTime CPVREpgInfoTag::EndAsUTC() const
-@@ -289,9 +287,7 @@ CDateTime CPVREpgInfoTag::EndAsUTC() const
+@@ -285,9 +283,7 @@ CDateTime CPVREpgInfoTag::EndAsUTC() const
  
  CDateTime CPVREpgInfoTag::EndAsLocalTime() const
  {
@@ -4793,7 +4793,7 @@
  
    m_iUniqueBroadcastId = EPG_TAG_INVALID_UID;
 diff --git a/xbmc/pvr/guilib/GUIEPGGridContainerModel.cpp b/xbmc/pvr/guilib/GUIEPGGridContainerModel.cpp
-index f9ade1683f..6a9937ee94 100644
+index 8adcab2056..5c88a4cb0f 100644
 --- a/xbmc/pvr/guilib/GUIEPGGridContainerModel.cpp
 +++ b/xbmc/pvr/guilib/GUIEPGGridContainerModel.cpp
 @@ -123,9 +123,9 @@ void CGUIEPGGridContainerModel::Initialize(const std::unique_ptr<CFileItemList>&
@@ -4822,10 +4822,10 @@
  
  std::string CPVRGUITimesInfo::GetTimeshiftStartTime(TIME_FORMAT format) const
 diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp
-index 3675ba6bbb..5b106bdedb 100644
+index fbc345d06e..7a52773356 100644
 --- a/xbmc/pvr/recordings/PVRRecording.cpp
 +++ b/xbmc/pvr/recordings/PVRRecording.cpp
-@@ -464,7 +464,7 @@ void CPVRRecording::UpdatePath()
+@@ -466,7 +466,7 @@ void CPVRRecording::UpdatePath()
  const CDateTime& CPVRRecording::RecordingTimeAsLocalTime() const
  {
    static CDateTime tmp;
@@ -4834,7 +4834,7 @@
  
    return tmp;
  }
-@@ -478,7 +478,7 @@ CDateTime CPVRRecording::EndTimeAsUTC() const
+@@ -480,7 +480,7 @@ CDateTime CPVRRecording::EndTimeAsUTC() const
  CDateTime CPVRRecording::EndTimeAsLocalTime() const
  {
    CDateTime ret;
@@ -4844,13 +4844,13 @@
  }
  
 -- 
-2.30.0
+2.31.1
 
 
-From c5eee5f37731e43b5f8ccced30d2eebf81d3d14b Mon Sep 17 00:00:00 2001
+From c681095ef7c2e3bf0a71d4e3c8eb64f5f82a6e2d Mon Sep 17 00:00:00 2001
 From: Vasyl Gello <vasek.gello@gmail.com>
 Date: Wed, 4 Nov 2020 11:13:15 +0200
-Subject: [PATCH 12/13] Get rid of {Set,}FromUTCDateTime
+Subject: [PATCH 12/17] Get rid of {Set,}FromUTCDateTime
 
   * The 'const CDateTime& CPVRRecording::RecordingTimeAsLocalTime() const'
     method needs 'static' CDateTime instance set explicitly. This manifested
@@ -4981,7 +4981,7 @@
  
    m_iUniqueBroadcastId = EPG_TAG_INVALID_UID;
 diff --git a/xbmc/pvr/guilib/GUIEPGGridContainerModel.cpp b/xbmc/pvr/guilib/GUIEPGGridContainerModel.cpp
-index 6a9937ee94..3d7e41b111 100644
+index 5c88a4cb0f..2447fb07b2 100644
 --- a/xbmc/pvr/guilib/GUIEPGGridContainerModel.cpp
 +++ b/xbmc/pvr/guilib/GUIEPGGridContainerModel.cpp
 @@ -123,9 +123,9 @@ void CGUIEPGGridContainerModel::Initialize(const std::unique_ptr<CFileItemList>&
@@ -5011,10 +5011,10 @@
  }
  
 diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp
-index 5b106bdedb..0589ff9908 100644
+index 7a52773356..f4dbea91fe 100644
 --- a/xbmc/pvr/recordings/PVRRecording.cpp
 +++ b/xbmc/pvr/recordings/PVRRecording.cpp
-@@ -463,9 +463,7 @@ void CPVRRecording::UpdatePath()
+@@ -465,9 +465,7 @@ void CPVRRecording::UpdatePath()
  
  const CDateTime& CPVRRecording::RecordingTimeAsLocalTime() const
  {
@@ -5025,7 +5025,7 @@
    return tmp;
  }
  
-@@ -477,9 +475,7 @@ CDateTime CPVRRecording::EndTimeAsUTC() const
+@@ -479,9 +477,7 @@ CDateTime CPVRRecording::EndTimeAsUTC() const
  
  CDateTime CPVRRecording::EndTimeAsLocalTime() const
  {
@@ -5074,13 +5074,13 @@
  {
    std::string dateTime1("Mon, 21 Oct 2018 12:16:24 GMT");
 -- 
-2.30.0
+2.31.1
 
 
-From ae97c4b1ceeb649913abe2944fa7ba5875dcf505 Mon Sep 17 00:00:00 2001
+From 0016dcfb75108ad4a622907b4941767ac68c00fc Mon Sep 17 00:00:00 2001
 From: Vasyl Gello <vasek.gello@gmail.com>
 Date: Wed, 6 Jan 2021 22:26:46 +0000
-Subject: [PATCH 13/13] Fix changes introduced in PR#19032
+Subject: [PATCH 13/17] Fix changes introduced in PR#19032
 
 Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
 ---
@@ -5101,5 +5101,651 @@
        }
      }
 -- 
-2.30.0
+2.31.1
+
+
+From c5883c119426f82f936373db112c8de13ab84f68 Mon Sep 17 00:00:00 2001
+From: Vasyl Gello <vasek.gello@gmail.com>
+Date: Thu, 13 May 2021 11:18:31 +0000
+Subject: [PATCH 14/17] Fix one-time assignment of PVR recording times
+
+Fixes pvr.dvbviewer#49
+Closes: #984682
+
+Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
+---
+ xbmc/pvr/recordings/PVRRecording.cpp | 5 ++---
+ xbmc/pvr/recordings/PVRRecording.h   | 2 +-
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp
+index f4dbea91fe..e7a073b1b7 100644
+--- a/xbmc/pvr/recordings/PVRRecording.cpp
++++ b/xbmc/pvr/recordings/PVRRecording.cpp
+@@ -463,10 +463,9 @@ void CPVRRecording::UpdatePath()
+     m_bIsDeleted, m_bRadio, m_strDirectory, m_strTitle, m_iSeason, m_iEpisode, GetYear(), m_strShowTitle, m_strChannelName, m_recordingTime, m_strRecordingId);
+ }
+ 
+-const CDateTime& CPVRRecording::RecordingTimeAsLocalTime() const
++const CDateTime CPVRRecording::RecordingTimeAsLocalTime() const
+ {
+-  static CDateTime tmp = m_recordingTime.GetAsLocalDateTime();
+-  return tmp;
++  return m_recordingTime.GetAsLocalDateTime();
+ }
+ 
+ CDateTime CPVRRecording::EndTimeAsUTC() const
+diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h
+index d472dcadcb..13ceefb6c5 100644
+--- a/xbmc/pvr/recordings/PVRRecording.h
++++ b/xbmc/pvr/recordings/PVRRecording.h
+@@ -207,7 +207,7 @@ namespace PVR
+      * @brief Retrieve the recording start as local time
+      * @return the recording start time
+      */
+-    const CDateTime& RecordingTimeAsLocalTime() const;
++    const CDateTime RecordingTimeAsLocalTime() const;
+ 
+     /*!
+      * @brief Retrieve the recording end as UTC time
+-- 
+2.31.1
+
+
+From edd044843736310f45304726d45ab9ca18ffc3d7 Mon Sep 17 00:00:00 2001
+From: Vasyl Gello <vasek.gello@gmail.com>
+Date: Fri, 14 May 2021 09:39:55 +0000
+Subject: [PATCH 15/17] Use double as underlying storage type for time points
+
+This should fix the GUI date dialog issue:
+
+https://github.com/xbmc/xbmc/pull/18727#issuecomment-840805031
+https://github.com/xbmc/xbmc/pull/18727#issuecomment-840805031
+
+Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
+---
+ xbmc/XBDateTime.cpp               | 18 +++++++++---------
+ xbmc/XBDateTime.h                 | 20 ++++++++++----------
+ xbmc/dialogs/GUIDialogNumeric.cpp |  2 +-
+ xbmc/utils/Archive.cpp            |  8 ++++----
+ xbmc/utils/Archive.h              |  4 ++--
+ xbmc/utils/test/TestArchive.cpp   | 12 ++++++------
+ 6 files changed, 32 insertions(+), 32 deletions(-)
+
+diff --git a/xbmc/XBDateTime.cpp b/xbmc/XBDateTime.cpp
+index 2d1873af58..9ecb83a86b 100644
+--- a/xbmc/XBDateTime.cpp
++++ b/xbmc/XBDateTime.cpp
+@@ -183,7 +183,7 @@ CDateTime::CDateTime(const time_t& time)
+   SetValid(true);
+ }
+ 
+-CDateTime::CDateTime(const std::chrono::system_clock::time_point& time)
++CDateTime::CDateTime(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& time)
+ {
+   m_time = time;
+   SetValid(true);
+@@ -230,7 +230,7 @@ const CDateTime& CDateTime::operator =(const tm& right)
+   return *this;
+ }
+ 
+-const CDateTime& CDateTime::operator=(const std::chrono::system_clock::time_point& right)
++const CDateTime& CDateTime::operator=(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right)
+ {
+   m_time = right;
+   SetValid(true);
+@@ -328,32 +328,32 @@ bool CDateTime::operator !=(const tm& right) const
+   return !operator ==(right);
+ }
+ 
+-bool CDateTime::operator>(const std::chrono::system_clock::time_point& right) const
++bool CDateTime::operator>(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const
+ {
+   return m_time > right;
+ }
+ 
+-bool CDateTime::operator>=(const std::chrono::system_clock::time_point& right) const
++bool CDateTime::operator>=(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const
+ {
+   return operator>(right) || operator==(right);
+ }
+ 
+-bool CDateTime::operator<(const std::chrono::system_clock::time_point& right) const
++bool CDateTime::operator<(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const
+ {
+   return m_time < right;
+ }
+ 
+-bool CDateTime::operator<=(const std::chrono::system_clock::time_point& right) const
++bool CDateTime::operator<=(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const
+ {
+   return operator<(right) || operator==(right);
+ }
+ 
+-bool CDateTime::operator==(const std::chrono::system_clock::time_point& right) const
++bool CDateTime::operator==(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const
+ {
+   return m_time == right;
+ }
+ 
+-bool CDateTime::operator!=(const std::chrono::system_clock::time_point& right) const
++bool CDateTime::operator!=(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const
+ {
+   return !operator==(right);
+ }
+@@ -583,7 +583,7 @@ void CDateTime::GetAsTm(tm& time) const
+   localtime_r(&t, &time);
+ }
+ 
+-std::chrono::system_clock::time_point CDateTime::GetAsTimePoint() const
++std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> CDateTime::GetAsTimePoint() const
+ {
+   return m_time;
+ }
+diff --git a/xbmc/XBDateTime.h b/xbmc/XBDateTime.h
+index fbb07a26ee..31b8192bf5 100644
+--- a/xbmc/XBDateTime.h
++++ b/xbmc/XBDateTime.h
+@@ -120,7 +120,7 @@ public:
+   CDateTime(const CDateTime& time);
+   explicit CDateTime(const time_t& time);
+   explicit CDateTime(const tm& time);
+-  explicit CDateTime(const std::chrono::system_clock::time_point& time);
++  explicit CDateTime(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& time);
+   CDateTime(int year, int month, int day, int hour, int minute, int second);
+ 
+   static CDateTime GetCurrentDateTime();
+@@ -137,7 +137,7 @@ public:
+ 
+   const CDateTime& operator =(const time_t& right);
+   const CDateTime& operator =(const tm& right);
+-  const CDateTime& operator=(const std::chrono::system_clock::time_point& right);
++  const CDateTime& operator=(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right);
+ 
+   bool operator >(const CDateTime& right) const;
+   bool operator >=(const CDateTime& right) const;
+@@ -160,12 +160,12 @@ public:
+   bool operator ==(const tm& right) const;
+   bool operator !=(const tm& right) const;
+ 
+-  bool operator>(const std::chrono::system_clock::time_point& right) const;
+-  bool operator>=(const std::chrono::system_clock::time_point& right) const;
+-  bool operator<(const std::chrono::system_clock::time_point& right) const;
+-  bool operator<=(const std::chrono::system_clock::time_point& right) const;
+-  bool operator==(const std::chrono::system_clock::time_point& right) const;
+-  bool operator!=(const std::chrono::system_clock::time_point& right) const;
++  bool operator>(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const;
++  bool operator>=(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const;
++  bool operator<(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const;
++  bool operator<=(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const;
++  bool operator==(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const;
++  bool operator!=(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& right) const;
+ 
+   CDateTime operator +(const CDateTimeSpan& right) const;
+   CDateTime operator -(const CDateTimeSpan& right) const;
+@@ -206,7 +206,7 @@ public:
+ 
+   void GetAsTime(time_t& time) const;
+   void GetAsTm(tm& time) const;
+-  std::chrono::system_clock::time_point GetAsTimePoint() const;
++  std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> GetAsTimePoint() const;
+ 
+   /*! \brief convert UTC datetime to local datetime
+    */
+@@ -228,7 +228,7 @@ public:
+   bool IsValid() const;
+ 
+ private:
+-  std::chrono::system_clock::time_point m_time;
++  std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> m_time;
+ 
+   typedef enum _STATE
+   {
+diff --git a/xbmc/dialogs/GUIDialogNumeric.cpp b/xbmc/dialogs/GUIDialogNumeric.cpp
+index 22b79ea9a1..4bb1272ace 100644
+--- a/xbmc/dialogs/GUIDialogNumeric.cpp
++++ b/xbmc/dialogs/GUIDialogNumeric.cpp
+@@ -496,7 +496,7 @@ bool CGUIDialogNumeric::ShowAndGetSeconds(std::string &timeString, const std::st
+   CGUIDialogNumeric *pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogNumeric>(WINDOW_DIALOG_NUMERIC);
+   if (!pDialog) return false;
+ 
+-  std::chrono::system_clock::time_point time{std::chrono::seconds{StringUtils::TimeStringToSeconds(timeString)}};
++  std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> time{std::chrono::seconds{StringUtils::TimeStringToSeconds(timeString)}};
+ 
+   CDateTime datetime(time);
+ 
+diff --git a/xbmc/utils/Archive.cpp b/xbmc/utils/Archive.cpp
+index 3d2ddf8da9..be267b6d22 100644
+--- a/xbmc/utils/Archive.cpp
++++ b/xbmc/utils/Archive.cpp
+@@ -151,9 +151,9 @@ CArchive& CArchive::operator<<(const std::wstring& wstr)
+   return streamout(wstr.data(), size * sizeof(wchar_t));
+ }
+ 
+-CArchive& CArchive::operator<<(const std::chrono::system_clock::time_point& time)
++CArchive& CArchive::operator<<(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& time)
+ {
+-  return streamout(&time, sizeof(std::chrono::system_clock::time_point));
++  return streamout(&time, sizeof(std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>));
+ }
+ 
+ CArchive& CArchive::operator<<(IArchivable& obj)
+@@ -264,9 +264,9 @@ CArchive& CArchive::operator>>(std::wstring& wstr)
+   return *this;
+ }
+ 
+-CArchive& CArchive::operator>>(std::chrono::system_clock::time_point& time)
++CArchive& CArchive::operator>>(std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& time)
+ {
+-  return streamin(&time, sizeof(std::chrono::system_clock::time_point));
++  return streamin(&time, sizeof(std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>));
+ }
+ 
+ CArchive& CArchive::operator>>(IArchivable& obj)
+diff --git a/xbmc/utils/Archive.h b/xbmc/utils/Archive.h
+index 313c6615f6..f3ee978ca1 100644
+--- a/xbmc/utils/Archive.h
++++ b/xbmc/utils/Archive.h
+@@ -54,7 +54,7 @@ public:
+   CArchive& operator<<(char c);
+   CArchive& operator<<(const std::string &str);
+   CArchive& operator<<(const std::wstring& wstr);
+-  CArchive& operator<<(const std::chrono::system_clock::time_point& time);
++  CArchive& operator<<(const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& time);
+   CArchive& operator<<(IArchivable& obj);
+   CArchive& operator<<(const CVariant& variant);
+   CArchive& operator<<(const std::vector<std::string>& strArray);
+@@ -123,7 +123,7 @@ public:
+ 
+   CArchive& operator>>(std::string &str);
+   CArchive& operator>>(std::wstring& wstr);
+-  CArchive& operator>>(std::chrono::system_clock::time_point& time);
++  CArchive& operator>>(std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>& time);
+   CArchive& operator>>(IArchivable& obj);
+   CArchive& operator>>(CVariant& variant);
+   CArchive& operator>>(std::vector<std::string>& strArray);
+diff --git a/xbmc/utils/test/TestArchive.cpp b/xbmc/utils/test/TestArchive.cpp
+index 41841c41df..5a63252cb5 100644
+--- a/xbmc/utils/test/TestArchive.cpp
++++ b/xbmc/utils/test/TestArchive.cpp
+@@ -223,8 +223,8 @@ TEST_F(TestArchive, StringArchive)
+ TEST_F(TestArchive, TimePointArchive)
+ {
+   ASSERT_NE(nullptr, file);
+-  std::chrono::system_clock::time_point tp_ref = std::chrono::system_clock::now();
+-  std::chrono::system_clock::time_point tp_var;
++  std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> tp_ref = std::chrono::system_clock::now();
++  std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> tp_var;
+ 
+   CArchive arstore(file, CArchive::store);
+   arstore << tp_ref;
+@@ -235,7 +235,7 @@ TEST_F(TestArchive, TimePointArchive)
+   arload >> tp_var;
+   arload.Close();
+ 
+-  EXPECT_TRUE(!memcmp(&tp_ref, &tp_var, sizeof(std::chrono::system_clock::time_point)));
++  EXPECT_TRUE(!memcmp(&tp_ref, &tp_var, sizeof(std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>)));
+ }
+ 
+ TEST_F(TestArchive, CVariantArchive)
+@@ -335,8 +335,8 @@ TEST_F(TestArchive, MultiTypeArchive)
+   char char_ref = 'A', char_var = '\0';
+   std::string string_ref = "test string", string_var;
+   std::wstring wstring_ref = L"test wstring", wstring_var;
+-  std::chrono::system_clock::time_point tp_ref = std::chrono::system_clock::now();
+-  std::chrono::system_clock::time_point tp_var;
++  std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> tp_ref = std::chrono::system_clock::now();
++  std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> tp_var;
+   CVariant CVariant_ref((int)1), CVariant_var;
+   std::vector<std::string> strArray_ref, strArray_var;
+   strArray_ref.emplace_back("test strArray_ref 0");
+@@ -398,7 +398,7 @@ TEST_F(TestArchive, MultiTypeArchive)
+   EXPECT_EQ(char_ref, char_var);
+   EXPECT_STREQ(string_ref.c_str(), string_var.c_str());
+   EXPECT_STREQ(wstring_ref.c_str(), wstring_var.c_str());
+-  EXPECT_TRUE(!memcmp(&tp_ref, &tp_var, sizeof(std::chrono::system_clock::time_point)));
++  EXPECT_TRUE(!memcmp(&tp_ref, &tp_var, sizeof(std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>>)));
+   EXPECT_TRUE(CVariant_var.isInteger());
+   EXPECT_STREQ("test strArray_ref 0", strArray_var.at(0).c_str());
+   EXPECT_STREQ("test strArray_ref 1", strArray_var.at(1).c_str());
+-- 
+2.31.1
+
+
+From 73305050967664e3a85dc7704134eeb43360a6c2 Mon Sep 17 00:00:00 2001
+From: Vasyl Gello <vasek.gello@gmail.com>
+Date: Fri, 14 May 2021 12:35:54 +0000
+Subject: [PATCH 16/17] Use "long double" type in time_t / tm conversions
+
+Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
+---
+ xbmc/XBDateTime.cpp | 60 +++++++++++++++++++++++++++------------------
+ 1 file changed, 36 insertions(+), 24 deletions(-)
+
+diff --git a/xbmc/XBDateTime.cpp b/xbmc/XBDateTime.cpp
+index 9ecb83a86b..2bc22c5809 100644
+--- a/xbmc/XBDateTime.cpp
++++ b/xbmc/XBDateTime.cpp
+@@ -99,10 +99,10 @@ const CDateTimeSpan& CDateTimeSpan::operator -=(const CDateTimeSpan& right)
+ 
+ void CDateTimeSpan::SetDateTimeSpan(int day, int hour, int minute, int second)
+ {
+-  m_timeSpan = std::chrono::duration_cast<std::chrono::seconds>(date::days(day)) +
+-               std::chrono::duration_cast<std::chrono::seconds>(std::chrono::hours(hour)) +
+-               std::chrono::duration_cast<std::chrono::seconds>(std::chrono::minutes(minute)) +
+-               std::chrono::duration_cast<std::chrono::seconds>(std::chrono::seconds(second));
++  m_timeSpan = date::floor<std::chrono::seconds>(date::days(day)) +
++               date::floor<std::chrono::seconds>(std::chrono::hours(hour)) +
++               date::floor<std::chrono::seconds>(std::chrono::minutes(minute)) +
++               date::floor<std::chrono::seconds>(std::chrono::seconds(second));
+ }
+ 
+ void CDateTimeSpan::SetFromTimeString(const std::string& time) // hh:mm
+@@ -146,7 +146,7 @@ int CDateTimeSpan::GetSeconds() const
+ 
+ int CDateTimeSpan::GetSecondsTotal() const
+ {
+-  return std::chrono::duration_cast<std::chrono::seconds>(m_timeSpan).count();
++  return date::floor<std::chrono::seconds>(m_timeSpan).count();
+ }
+ 
+ void CDateTimeSpan::SetFromPeriod(const std::string &period)
+@@ -179,7 +179,8 @@ CDateTime::CDateTime(const CDateTime& time)
+ 
+ CDateTime::CDateTime(const time_t& time)
+ {
+-  m_time = std::chrono::system_clock::from_time_t(time);
++  Reset();
++  m_time += std::chrono::duration<long double>(time);
+   SetValid(true);
+ }
+ 
+@@ -191,7 +192,8 @@ CDateTime::CDateTime(const std::chrono::time_point<std::chrono::system_clock, st
+ 
+ CDateTime::CDateTime(const tm& time)
+ {
+-  m_time = std::chrono::system_clock::from_time_t(std::mktime(const_cast<tm*>(&time)));
++  Reset();
++  m_time += std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&time)));
+   SetValid(true);
+ }
+ 
+@@ -205,7 +207,7 @@ CDateTime CDateTime::GetCurrentDateTime()
+   auto zone = date::make_zoned(date::current_zone(), std::chrono::system_clock::now());
+ 
+   return CDateTime(
+-      std::chrono::duration_cast<std::chrono::seconds>(zone.get_local_time().time_since_epoch())
++      date::floor<std::chrono::seconds>(zone.get_local_time().time_since_epoch())
+           .count());
+ }
+ 
+@@ -216,7 +218,8 @@ CDateTime CDateTime::GetUTCDateTime()
+ 
+ const CDateTime& CDateTime::operator =(const time_t& right)
+ {
+-  m_time = std::chrono::system_clock::from_time_t(right);
++  Reset();
++  m_time += std::chrono::duration<long double>(right);
+   SetValid(true);
+ 
+   return *this;
+@@ -224,7 +227,8 @@ const CDateTime& CDateTime::operator =(const time_t& right)
+ 
+ const CDateTime& CDateTime::operator =(const tm& right)
+ {
+-  m_time = std::chrono::system_clock::from_time_t(std::mktime(const_cast<tm*>(&right)));
++  Reset();
++  m_time += std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&right)));
+   SetValid(true);
+ 
+   return *this;
+@@ -270,7 +274,8 @@ bool CDateTime::operator !=(const CDateTime& right) const
+ 
+ bool CDateTime::operator >(const time_t& right) const
+ {
+-  return m_time > std::chrono::system_clock::from_time_t(right);
++  return m_time > std::chrono::system_clock::from_time_t(0) +
++    std::chrono::duration<long double>(right);
+ }
+ 
+ bool CDateTime::operator >=(const time_t& right) const
+@@ -280,7 +285,8 @@ bool CDateTime::operator >=(const time_t& right) const
+ 
+ bool CDateTime::operator <(const time_t& right) const
+ {
+-  return m_time < std::chrono::system_clock::from_time_t(right);
++  return m_time < std::chrono::system_clock::from_time_t(0) +
++    std::chrono::duration<long double>(right);
+ }
+ 
+ bool CDateTime::operator <=(const time_t& right) const
+@@ -290,7 +296,8 @@ bool CDateTime::operator <=(const time_t& right) const
+ 
+ bool CDateTime::operator ==(const time_t& right) const
+ {
+-  return m_time == std::chrono::system_clock::from_time_t(right);
++  return m_time == std::chrono::system_clock::from_time_t(0) +
++    std::chrono::duration<long double>(right);
+ }
+ 
+ bool CDateTime::operator !=(const time_t& right) const
+@@ -300,7 +307,8 @@ bool CDateTime::operator !=(const time_t& right) const
+ 
+ bool CDateTime::operator >(const tm& right) const
+ {
+-  return m_time > std::chrono::system_clock::from_time_t(std::mktime(const_cast<tm*>(&right)));
++  return m_time > std::chrono::system_clock::from_time_t(0) +
++    std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&right)));
+ }
+ 
+ bool CDateTime::operator >=(const tm& right) const
+@@ -310,7 +318,8 @@ bool CDateTime::operator >=(const tm& right) const
+ 
+ bool CDateTime::operator <(const tm& right) const
+ {
+-  return m_time < std::chrono::system_clock::from_time_t(std::mktime(const_cast<tm*>(&right)));
++  return m_time < std::chrono::system_clock::from_time_t(0) +
++    std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&right)));
+ }
+ 
+ bool CDateTime::operator <=(const tm& right) const
+@@ -320,7 +329,8 @@ bool CDateTime::operator <=(const tm& right) const
+ 
+ bool CDateTime::operator ==(const tm& right) const
+ {
+-  return m_time == std::chrono::system_clock::from_time_t(std::mktime(const_cast<tm*>(&right)));
++  return m_time == std::chrono::system_clock::from_time_t(0) +
++    std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&right)));
+ }
+ 
+ bool CDateTime::operator !=(const tm& right) const
+@@ -394,7 +404,7 @@ CDateTimeSpan CDateTime::operator -(const CDateTime& right) const
+ {
+   CDateTimeSpan left;
+ 
+-  left.m_timeSpan = std::chrono::duration_cast<std::chrono::seconds>(m_time - right.m_time);
++  left.m_timeSpan = date::floor<std::chrono::seconds>(m_time - right.m_time);
+   return left;
+ }
+ 
+@@ -503,7 +513,7 @@ int CDateTime::GetYear() const
+ int CDateTime::GetHour() const
+ {
+   auto dp = date::floor<date::days>(m_time);
+-  auto time = date::make_time(m_time - dp);
++  auto time = date::make_time(date::floor<std::chrono::seconds>(m_time - dp));
+ 
+   return time.hours().count();
+ }
+@@ -511,7 +521,7 @@ int CDateTime::GetHour() const
+ int CDateTime::GetMinute() const
+ {
+   auto dp = date::floor<date::days>(m_time);
+-  auto time = date::make_time(m_time - dp);
++  auto time = date::make_time(date::floor<std::chrono::seconds>(m_time - dp));
+ 
+   return time.minutes().count();
+ }
+@@ -519,7 +529,7 @@ int CDateTime::GetMinute() const
+ int CDateTime::GetSecond() const
+ {
+   auto dp = date::floor<date::days>(m_time);
+-  auto time = date::make_time(m_time - dp);
++  auto time = date::make_time(date::floor<std::chrono::seconds>(m_time - dp));
+ 
+   return time.seconds().count();
+ }
+@@ -536,7 +546,7 @@ int CDateTime::GetMinuteOfDay() const
+ {
+   auto dp = date::floor<std::chrono::hours>(m_time);
+   ;
+-  auto time = date::make_time(m_time - dp);
++  auto time = date::make_time(date::floor<std::chrono::seconds>(m_time - dp));
+ 
+   return time.hours().count() * 60 + time.minutes().count();
+ }
+@@ -573,12 +583,14 @@ bool CDateTime::SetTime(int hour, int minute, int second)
+ 
+ void CDateTime::GetAsTime(time_t& time) const
+ {
+-  time = std::chrono::system_clock::to_time_t(m_time);
++  time = date::floor<std::chrono::seconds>(m_time.time_since_epoch())
++                .count();
+ }
+ 
+ void CDateTime::GetAsTm(tm& time) const
+ {
+-  auto t = std::chrono::system_clock::to_time_t(m_time);
++  auto t = date::floor<std::chrono::seconds>(m_time.time_since_epoch())
++                .count();
+ 
+   localtime_r(&t, &time);
+ }
+@@ -1186,7 +1198,7 @@ CDateTime CDateTime::GetAsLocalDateTime() const
+   auto zone = date::make_zoned(date::current_zone(), m_time);
+ 
+   return CDateTime(
+-      std::chrono::duration_cast<std::chrono::seconds>(zone.get_local_time().time_since_epoch())
++      date::floor<std::chrono::seconds>(zone.get_local_time().time_since_epoch())
+           .count());
+ }
+ 
+-- 
+2.31.1
+
+
+From 84717876235e70622e6436314942374707dd28fe Mon Sep 17 00:00:00 2001
+From: Vasyl Gello <vasek.gello@gmail.com>
+Date: Mon, 17 May 2021 09:41:32 +0000
+Subject: [PATCH 17/17] Avoid time_t in tm conversions
+
+This should leave the possibility of time_t truncation on 32-bit
+architectures only in GetAsTime(), what we can do nothing with.
+
+Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
+---
+ xbmc/XBDateTime.cpp | 52 +++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 41 insertions(+), 11 deletions(-)
+
+diff --git a/xbmc/XBDateTime.cpp b/xbmc/XBDateTime.cpp
+index 2bc22c5809..ba0d16243f 100644
+--- a/xbmc/XBDateTime.cpp
++++ b/xbmc/XBDateTime.cpp
+@@ -193,7 +193,14 @@ CDateTime::CDateTime(const std::chrono::time_point<std::chrono::system_clock, st
+ CDateTime::CDateTime(const tm& time)
+ {
+   Reset();
+-  m_time += std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&time)));
++
++  auto ymd = date::local_days(date::year(time.tm_year + 1900) / date::month(time.tm_mon + 1) / time.tm_mday);
++  auto dur = ymd + std::chrono::hours(time.tm_hour) + std::chrono::minutes(time.tm_min) + std::chrono::seconds(time.tm_sec);
++
++  auto timeT = date::floor<std::chrono::seconds>(dur.time_since_epoch()).count();
++
++  m_time += std::chrono::duration<long double>(timeT);
++
+   SetValid(true);
+ }
+ 
+@@ -228,7 +235,14 @@ const CDateTime& CDateTime::operator =(const time_t& right)
+ const CDateTime& CDateTime::operator =(const tm& right)
+ {
+   Reset();
+-  m_time += std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&right)));
++
++  auto ymd = date::local_days(date::year(right.tm_year + 1900) / date::month(right.tm_mon + 1) / right.tm_mday);
++  auto dur = ymd + std::chrono::hours(right.tm_hour) + std::chrono::minutes(right.tm_min) + std::chrono::seconds(right.tm_sec);
++
++  auto timeT = date::floor<std::chrono::seconds>(dur.time_since_epoch()).count();
++
++  m_time += std::chrono::duration<long double>(timeT);
++
+   SetValid(true);
+ 
+   return *this;
+@@ -307,8 +321,8 @@ bool CDateTime::operator !=(const time_t& right) const
+ 
+ bool CDateTime::operator >(const tm& right) const
+ {
+-  return m_time > std::chrono::system_clock::from_time_t(0) +
+-    std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&right)));
++  CDateTime temp(right);
++  return m_time > temp.m_time;
+ }
+ 
+ bool CDateTime::operator >=(const tm& right) const
+@@ -318,8 +332,8 @@ bool CDateTime::operator >=(const tm& right) const
+ 
+ bool CDateTime::operator <(const tm& right) const
+ {
+-  return m_time < std::chrono::system_clock::from_time_t(0) +
+-    std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&right)));
++  CDateTime temp(right);
++  return m_time < temp.m_time;
+ }
+ 
+ bool CDateTime::operator <=(const tm& right) const
+@@ -329,8 +343,8 @@ bool CDateTime::operator <=(const tm& right) const
+ 
+ bool CDateTime::operator ==(const tm& right) const
+ {
+-  return m_time == std::chrono::system_clock::from_time_t(0) +
+-    std::chrono::duration<long double>(std::mktime(const_cast<tm*>(&right)));
++  CDateTime temp(right);
++  return m_time == temp.m_time;
+ }
+ 
+ bool CDateTime::operator !=(const tm& right) const
+@@ -589,10 +603,26 @@ void CDateTime::GetAsTime(time_t& time) const
+ 
+ void CDateTime::GetAsTm(tm& time) const
+ {
+-  auto t = date::floor<std::chrono::seconds>(m_time.time_since_epoch())
+-                .count();
++  auto dp = date::floor<date::days>(m_time);
++
++  auto ymd = date::year_month_day{dp};
++  time.tm_year = int(ymd.year()) - 1900;
++  time.tm_mon  = unsigned(ymd.month()) - 1;
++  time.tm_mday = unsigned(ymd.day());
++
++  auto hms = date::make_time(date::floor<std::chrono::seconds>(m_time - dp));
++  time.tm_hour = hms.hours().count();
++  time.tm_min  = hms.minutes().count();
++  time.tm_sec  = hms.seconds().count();
++
++  date::weekday wd{dp};
++  time.tm_wday = wd.c_encoding();
++
++  auto newyear = date::sys_days(date::year(time.tm_year + 1900) / 1 / 1);
++  auto seconds_to_newyear = date::floor<std::chrono::seconds>(m_time - newyear);
++  time.tm_yday = seconds_to_newyear.count() / 86400;
+ 
+-  localtime_r(&t, &time);
++  time.tm_isdst = date::current_zone()->get_info(m_time).save.count() != 0;
+ }
+ 
+ std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long double, std::nano>> CDateTime::GetAsTimePoint() const
+-- 
+2.31.1
 
diff -Nru kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0002-Use-Debian-tzdata.patch kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0002-Use-Debian-tzdata.patch
--- kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0002-Use-Debian-tzdata.patch	2021-02-19 00:02:45.000000000 +0000
+++ kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0002-Use-Debian-tzdata.patch	2021-05-30 04:57:39.000000000 +0000
@@ -127,6 +127,19 @@
  #define HAS_REMOTE_API 0
  #include <date/date.h>
  #include <date/tz.h>
+diff --git a/xbmc/XBDateTime.cpp b/xbmc/XBDateTime.cpp
+index 3d1211ee..0f66ec78 100644
+--- a/xbmc/XBDateTime.cpp
++++ b/xbmc/XBDateTime.cpp
+@@ -17,7 +17,7 @@
+ 
+ #include <cstdlib>
+ 
+-#define USE_OS_TZDB 0
++#define USE_OS_TZDB 1
+ #define HAS_REMOTE_API 0
+ #include <date/date.h>
+ #include <date/iso_week.h>
 -- 
 2.17.1
 
diff -Nru kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0004-date-library-crash-fix.patch kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0004-date-library-crash-fix.patch
--- kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0004-date-library-crash-fix.patch	1970-01-01 00:00:00.000000000 +0000
+++ kodi-19.0+dfsg1/debian/patches/cdatetime-std-chrono/0004-date-library-crash-fix.patch	2021-05-30 04:57:39.000000000 +0000
@@ -0,0 +1,55 @@
+From 658a3b94955d876675caca033fb799f5169a389c Mon Sep 17 00:00:00 2001
+From: Howard Hinnant <howard.hinnant@gmail.com>
+Date: Mon, 17 Aug 2020 21:32:29 -0400
+Subject: [PATCH] Fix crasher for early local times and USE_OS_TZDB=1
+
+---
+ src/tz.cpp | 27 +++++++++++++++++++--------
+ 1 file changed, 19 insertions(+), 8 deletions(-)
+
+diff --git a/libdate-tz-embedded/src/tz.cpp b/libdate-tz-embedded/src/tz.cpp
+index f455f22a..b5f02444 100644
+--- a/libdate-tz-embedded/src/tz.cpp
++++ b/libdate-tz-embedded/src/tz.cpp
+@@ -2125,14 +2125,25 @@ time_zone::load_sys_info(std::vector<detail::transition>::const_iterator i) cons
+ {
+     using namespace std::chrono;
+     assert(!transitions_.empty());
+-    assert(i != transitions_.begin());
+     sys_info r;
+-    r.begin = i[-1].timepoint;
+-    r.end = i != transitions_.end() ? i->timepoint :
+-                                      sys_seconds(sys_days(year::max()/max_day));
+-    r.offset = i[-1].info->offset;
+-    r.save = i[-1].info->is_dst ? minutes{1} : minutes{0};
+-    r.abbrev = i[-1].info->abbrev;
++    if (i != transitions_.begin())
++    {
++        r.begin = i[-1].timepoint;
++        r.end = i != transitions_.end() ? i->timepoint :
++                                          sys_seconds(sys_days(year::max()/max_day));
++        r.offset = i[-1].info->offset;
++        r.save = i[-1].info->is_dst ? minutes{1} : minutes{0};
++        r.abbrev = i[-1].info->abbrev;
++    }
++    else
++    {
++        r.begin = sys_days(year::min()/min_day);
++        r.end = i+1 != transitions_.end() ? i[1].timepoint :
++                                          sys_seconds(sys_days(year::max()/max_day));
++        r.offset = i[0].info->offset;
++        r.save = i[0].info->is_dst ? minutes{1} : minutes{0};
++        r.abbrev = i[0].info->abbrev;
++    }
+     return r;
+ }
+ 
+@@ -2167,7 +2178,7 @@ time_zone::get_info_impl(local_seconds tp) const
+     {
+         i.second = load_sys_info(--tr);
+         tps = sys_seconds{(tp - i.second.offset).time_since_epoch()};
+-        if (tps < i.second.end)
++        if (tps < i.second.end && i.first.end != i.second.end)
+         {
+            i.result = local_info::ambiguous;
+            std::swap(i.first, i.second);
diff -Nru kodi-19.0+dfsg1/debian/patches/series kodi-19.0+dfsg1/debian/patches/series
--- kodi-19.0+dfsg1/debian/patches/series	2021-02-19 00:02:45.000000000 +0000
+++ kodi-19.0+dfsg1/debian/patches/series	2021-05-30 04:57:39.000000000 +0000
@@ -40,3 +40,4 @@
 cdatetime-std-chrono/0001-Replace-Kodi-date-time-implementation-with-std-c.patch
 cdatetime-std-chrono/0002-Use-Debian-tzdata.patch
 cdatetime-std-chrono/0003-Reinstate-date-library-Makefile.patch
+cdatetime-std-chrono/0004-date-library-crash-fix.patch
diff -Nru kodi-19.0+dfsg1/debian/watch kodi-19.0+dfsg1/debian/watch
--- kodi-19.0+dfsg1/debian/watch	2021-02-19 00:02:45.000000000 +0000
+++ kodi-19.0+dfsg1/debian/watch	2021-05-30 04:57:39.000000000 +0000
@@ -29,7 +29,7 @@
       repacksuffix=+dfsg1,\
       uversionmangle=s/\([\.0-9a-zA-Z]\)-.*$/\1/;s/rc/~rc/;s/a/~alpha/;s/b/~beta/;s/RC/~rc/;s/A/~alpha/;s/B/~beta/, \
       dversionmangle=auto" \
-https://github.com/xbmc/xbmc/tags .*archive/?(\d\S*)-[A-Z].*\.tar\.gz
+https://github.com/xbmc/xbmc/releases .*archive/refs/tags/?(\d\S*)-[A-Z].*\.tar\.gz
 
 # date
 
@@ -37,7 +37,7 @@
       repack, \
       compression=xz, \
       dversionmangle=auto" \
-https://github.com/HowardHinnant/date/tags .*archive/v?(\d\S*)\.tar\.gz \
+https://github.com/HowardHinnant/date/releases .*archive/refs/tags/v?(\d\S*)\.tar\.gz \
 ignore
 
 # libdvdread

Reply to: