diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/changelog mythtv-32.0+fixes.20220325.f69ce764b7/debian/changelog --- mythtv-32.0+fixes.20220224.56275b303b/debian/changelog 2022-03-13 07:59:29.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/changelog 2022-03-25 17:15:07.000000000 +0000 @@ -1,33 +1,9 @@ -mythtv (2:32.0+fixes.20220224.56275b303b-0ubuntu5) jammy; urgency=medium +mythtv (2:32.0+fixes.20220325.f69ce764b7-0ubuntu1) jammy; urgency=medium - * Rebuild against new old libsndio7.0. + * Scripted Build from fixes git packaging [61973f1] + * New upstream checkout (f69ce764b7) - -- Gianfranco Costamagna Sun, 13 Mar 2022 08:59:29 +0100 - -mythtv (2:32.0+fixes.20220224.56275b303b-0ubuntu4) jammy; urgency=medium - - * No-change rebuild against libsndio7.0 - - -- Steve Langasek Sat, 12 Mar 2022 05:04:14 +0000 - -mythtv (2:32.0+fixes.20220224.56275b303b-0ubuntu3) jammy; urgency=medium - - * Rebuild against new libx264-163. - - -- Gianfranco Costamagna Mon, 07 Mar 2022 15:31:42 +0100 - -mythtv (2:32.0+fixes.20220224.56275b303b-0ubuntu2) jammy; urgency=medium - - * Drop architectures that upstream doesn't care about. - - -- Mario Limonciello Fri, 25 Feb 2022 20:40:50 -0600 - -mythtv (2:32.0+fixes.20220224.56275b303b-0ubuntu1) jammy; urgency=medium - - * New fixes build, should fix FTBFS with armhf/s390x - * New upstream checkout (56275b303b) - - -- Mario Limonciello Thu, 24 Feb 2022 19:09:21 -0600 + -- Mario Limonciello Fri, 25 Mar 2022 12:15:07 -0500 mythtv (2:32.0+fixes) jammy; urgency=medium diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/control.in mythtv-32.0+fixes.20220325.f69ce764b7/debian/control.in --- mythtv-32.0+fixes.20220224.56275b303b/debian/control.in 2022-02-25 01:09:15.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/control.in 2022-03-25 17:00:25.000000000 +0000 @@ -137,7 +137,7 @@ mythtv-backend (backend needing a remote database) Package: mythtv-common -Architecture: any +Architecture: amd64 arm64 Pre-Depends: pwgen, Depends: adduser, default-mysql-client | virtual-mysql-client | mysql-client-5.7 | mysql-client-5.6 | mariadb-client, @@ -238,7 +238,7 @@ installed on the system where the MySQL server resides. Package: mythtv-backend -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-common, mythtv-transcode-utils, ${shlibs:Depends}, cron, wget, zenity | kdebase-bin, xterm, python3, libjs-jquery, libxml-simple-perl, ${misc:Depends} Conflicts: mythtv (<< 0.8-1) Replaces: mythtv (<< 0.8-1), mythtv-frontend (<= 0.20-0.4) @@ -260,7 +260,7 @@ package. Package: mythtv-transcode-utils -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-common, ${shlibs:Depends}, ${misc:Depends} Conflicts: mythtv-backend (<< 0.20.2-0ubuntu1) Replaces: mythtv-backend (<< 0.20.2-0ubuntu1) @@ -271,7 +271,7 @@ requiring an entire backend to be installed. Package: mythtv-frontend -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-common, ${shlibs:Depends}, ${misc:Depends}, @@ -305,7 +305,7 @@ package. Package: libmyth -Architecture: any +Architecture: amd64 arm64 Section: libs Depends: ${shlibs:Depends}, libqt5sql5-mysql, ${misc:Depends} Conflicts: mythtv (<< 0.7-5), libmyth-0.23-0, libmyth-0.24-0, libmyth-0.25-0, libmyth-0.26-0, libmyth-0.27-0, libmyth-0.28-0, libmyth-0.29-0, libmyth-29-0 @@ -318,7 +318,7 @@ components in the system. Package: libmyth-dev -Architecture: any +Architecture: amd64 arm64 Section: libdevel Depends: libmyth (= ${binary:Version}), ${misc:Depends} Conflicts: libmyth-0.23-0-dev, libmyth-0.24-0-dev, libmyth-0.25-0-dev, libmyth-0.26-0-dev, libmyth-0.27-0-dev, libmyth-0.28-0-dev, libmyth-0.29-0-dev, libmyth-29-0-dev @@ -393,7 +393,7 @@ on anything but the first backend machine on the network. Package: mythtv-dbg -Architecture: any +Architecture: amd64 arm64 Section: debug Priority: extra Recommends: libc6-dbg @@ -421,7 +421,7 @@ This Metapackage will install all available MythTV plugins. Package: mythgame -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-frontend (>= ${binary:Version}), python3, libzip-dev, @@ -432,7 +432,7 @@ runs. Package: mythmusic -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-frontend (>= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} @@ -443,7 +443,7 @@ drive. Package: mythnews -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-frontend (>= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} @@ -451,7 +451,7 @@ MythNews will fetch RSS feeds for you to read. Package: mythweather -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-frontend (>= ${binary:Version}), ${shlibs:Depends}, ${perl:Depends}, @@ -496,7 +496,7 @@ music streams as well. Package: mytharchive -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-transcode-utils(>= ${binary:Version}), mythtv-frontend (>= ${binary:Version}), mjpegtools, @@ -525,7 +525,7 @@ and the mythfrontend UI plugin. Package: mythzoneminder -Architecture: any +Architecture: amd64 arm64 Suggests: zoneminder Depends: mythtv-frontend (>= ${binary:Version}), ${shlibs:Depends}, @@ -536,7 +536,7 @@ recorded surveillance footage. Package: mythbrowser -Architecture: any +Architecture: amd64 arm64 Depends: mythtv-frontend (>= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/DESCRIBE mythtv-32.0+fixes.20220325.f69ce764b7/debian/DESCRIBE --- mythtv-32.0+fixes.20220224.56275b303b/debian/DESCRIBE 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/DESCRIBE 2022-03-25 17:00:31.000000000 +0000 @@ -1,2 +1,2 @@ BRANCH="fixes/32" -SOURCE_VERSION="v32.0-3-g75cf5040ef" +SOURCE_VERSION="v32.0-14-gf69ce764b7" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/mythfrontend.sh mythtv-32.0+fixes.20220325.f69ce764b7/debian/mythfrontend.sh --- mythtv-32.0+fixes.20220224.56275b303b/debian/mythfrontend.sh 2022-02-25 01:09:15.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/mythfrontend.sh 2022-03-25 17:00:25.000000000 +0000 @@ -2,6 +2,7 @@ # Mario Limonciello, March 2007 # partially merged with startmythtv.sh by Michael Haas, October 2007 # Mike Bibbings July 2019 remove find_session (obsolete due to removal of gksu,kdesu etc) +# Modified to reset screensaver if mythfrontend.real crashes by StoicTheVast, March 2022 pidof mythfrontend.real 2>&1 >/dev/null && wmctrl -a "MythTV Frontend" 2>/dev/null && exit 0 @@ -15,6 +16,15 @@ #check that we are in the mythtv group check_groups +#get and store original DPMS parameters +DPMSENABLED=FALSE +if xset -q |grep -qi "DPMS is Enabled" ; then + DPMSENABLED=TRUE + XSETTIMEOUTLINE=$(xset -q |egrep -i "timeout:.*cycle:") + DPMSTIMEOUT=$(echo $XSETTIMEOUTLINE | awk ' { print $2 } ') + DPMSCYCLE=$(echo $XSETTIMEOUTLINE | awk ' { print $4 } ') +fi + if [ "$1" = "--service" ]; then #source frontend session settings if [ -f /etc/mythtv/session-settings ]; then @@ -37,6 +47,11 @@ RET=$? [ "$RET" = "0" -o "$RET" = "1" -o "$RET" = "130" -o "$RET" = "254" ] do + # restore original DPMS parameters + if [ "$DPMSENABLED" = "TRUE" ]; then + xset +dpms + xset s $DPMSTIMEOUT $DPMSCYCLE + fi notify-send -i info 'Restarting Frontend' "The front-end crashed unexpectedly (exit code $RET) and is restarting. Please wait..." done fi @@ -46,6 +61,11 @@ # if group membership is okay, go ahead and launch if [ "$IGNORE_NOT" = "0" ]; then exec $environ /usr/bin/mythfrontend.real --syslog local7 "$@" + # restore original DPMS parameters + if [ "$DPMSENABLED" = "TRUE" ]; then + xset +dpms + xset s $DPMSTIMEOUT $DPMSCYCLE + fi fi fi diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/ca.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/ca.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/ca.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/ca.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Catalan \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/de.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/de.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/de.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/de.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: 2007-06-05 12:54+0200\n" "Last-Translator: laga\n" "Language-Team: Deutsch \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/es.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/es.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/es.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/es.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: 2007-09-18 07:44+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Spanish \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/fi.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/fi.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/fi.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/fi.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Finnish \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/fr.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/fr.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/fr.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/fr.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv 0.18.1\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: 2005-12-23 15:48+0100\n" "Last-Translator: Christian Marillat\n" "Language-Team: French \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/he.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/he.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/he.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/he.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: 2007-09-08 21:57+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Hebrew \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/it.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/it.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/it.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/it.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: 2007-09-27 09:35+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Italian \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/nl.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/nl.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/nl.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/nl.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Dutch \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/oc.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/oc.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/oc.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/oc.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: 2007-09-30 21:18+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Occitan (post 1500) \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/pl.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/pl.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/pl.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/pl.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Polish \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/pt_BR.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/pt_BR.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/pt_BR.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/pt_BR.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: 2007-08-31 15:38+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Brazilian Portuguese \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/sv.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/sv.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/sv.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/sv.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: 2007-09-01 22:24+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Swedish \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/templates.pot mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/templates.pot --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/templates.pot 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/templates.pot 2022-03-25 17:00:31.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/debian/po/zh_CN.po mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/zh_CN.po --- mythtv-32.0+fixes.20220224.56275b303b/debian/po/zh_CN.po 2022-02-25 01:09:21.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/debian/po/zh_CN.po 2022-03-25 17:00:31.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mythtv\n" "Report-Msgid-Bugs-To: mythtv@packages.debian.org\n" -"POT-Creation-Date: 2022-02-24 19:09-0600\n" +"POT-Creation-Date: 2022-03-25 12:00-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Simplified Chinese \n" diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/configure mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/configure --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/configure 2022-02-25 00:05:06.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/configure 2022-03-25 17:00:15.000000000 +0000 @@ -4308,9 +4308,10 @@ fi } - [ "$cpu" = generic ] && cpu=$(probe_arm_arch) - case $cpu in + generic) + subarch=$(probe_arm_arch | sed 's/[^a-z0-9]//g') + ;; armv*) cpuflags="-march=$cpu" subarch=$(echo $cpu | sed 's/[^a-z0-9]//g') diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/mythdate.cpp mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/mythdate.cpp --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/mythdate.cpp 2022-02-25 00:05:05.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/mythdate.cpp 2022-03-25 17:00:15.000000000 +0000 @@ -1,5 +1,6 @@ #include #include +#include #include "mythcorecontext.h" #include "mythdate.h" @@ -206,4 +207,69 @@ return std::chrono::seconds(MythDate::current().secsTo(future)); } +/** + * \brief Format a milliseconds time value + * + * Convert a millisecond time value into a textual representation of + * the value. QTime can't handle overflow of any of the fields, so the + * formatting needs to be done manually. Think a music playlist of + * more than 24 hours, or a single song of more than 60 minutes + * (e.g. a podcast or something like that). + * + * \param msecs The time value in milliseconds. Since the type of this + * field is std::chrono::duration, any duration of a larger + * interval can be passed to this function and the compiler will + * convert it to milliseconds. + * + * \param fmt A formatting string specifying how to output the time. + * Valid formatting characters are "Hmsz" for hours, minutes, seconds, + * and milliseconds, respectively. Consecutive runs of these characters will + * be replaced by at least as many characters as the run length, zero padding + * if necessary. + */ +QString formatTime(std::chrono::milliseconds msecs, QString fmt) +{ + static const QRegularExpression hRe("H+"); + static const QRegularExpression mRe("m+"); + static const QRegularExpression sRe("s+"); + static const QRegularExpression zRe("z+"); + + QRegularExpressionMatch match = hRe.match(fmt); + if (match.hasMatch()) + { + int width = match.capturedLength(); + QString text = QString("%1").arg(msecs / 1h, width,10,QLatin1Char('0')); + fmt.replace(match.capturedStart(), width, text); + msecs = msecs % 1h; + } + + match = mRe.match(fmt); + if (match.hasMatch()) + { + int width = match.capturedLength(); + QString text = QString("%1").arg(msecs / 1min, width,10,QLatin1Char('0')); + fmt.replace(match.capturedStart(), width, text); + msecs = msecs % 1min; + } + + match = sRe.match(fmt); + if (match.hasMatch()) + { + int width = match.capturedLength(); + QString text = QString("%1").arg(msecs / 1s, width,10,QLatin1Char('0')); + fmt.replace(match.capturedStart(), width, text); + } + + match = zRe.match(fmt); + if (match.hasMatch()) + { + static constexpr std::array divisor = {1000, 100, 10, 1}; + int width = std::min(3, static_cast(match.capturedLength())); + int value = (msecs % 1s).count() / divisor[width]; + QString text = QString("%1").arg(value, width,10,QLatin1Char('0')); + fmt.replace(match.capturedStart(), match.capturedLength(), text); + } + return fmt; +} + }; // namespace MythDate diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/mythdate.h mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/mythdate.h --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/mythdate.h 2022-02-25 00:05:05.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/mythdate.h 2022-03-25 17:00:15.000000000 +0000 @@ -1,13 +1,11 @@ #ifndef MYTH_DATE_H #define MYTH_DATE_H -#include -using namespace std::chrono_literals; - #include #include #include "mythbaseexp.h" +#include "mythchrono.h" namespace MythDate { @@ -60,24 +58,8 @@ MBASE_PUBLIC std::chrono::seconds secsInPast (const QDateTime& past); MBASE_PUBLIC std::chrono::seconds secsInFuture (const QDateTime& future); -/** - * \brief Format a milliseconds time value - * - * Convert a millisecond time value into a textual representation of the value. - * - * \param msecs The time value in milliseconds. Since the type of this - * field is std::chrono::duration, any duration of a larger - * interval can be passed to this function and the compiler will - * convert it to milliseconds. - * - * \param fmt A formatting string specifying how to output the time. - * See QTime::toString for the a definition fo valid formatting - * characters. - */ -inline QString formatTime(std::chrono::milliseconds msecs, const QString& fmt) -{ - return QTime::fromMSecsSinceStartOfDay(msecs.count()).toString(fmt); -} +MBASE_PUBLIC QString formatTime(std::chrono::milliseconds msecs, + QString fmt = "HH:mm:ss"); } // namespace MythDate diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.cpp mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.cpp --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.cpp 1970-01-01 00:00:00.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.cpp 2022-03-25 17:00:15.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * Class TestMythDate + * + * Copyright (c) David Hampton 2022 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "test_mythdate.h" + +void TestMythDate::formatting_data(void) +{ + QTest::addColumn("msecs"); + QTest::addColumn("fmt"); + QTest::addColumn("expected"); + + QTest::newRow( "m:ss") << 192876ms << "m:ss" << "3:12"; + QTest::newRow( "mm:ss") << 192876ms << "mm:ss" << "03:12"; + QTest::newRow( "mm:ss oflow") << 17112876ms << "mm:ss" << "285:12"; + QTest::newRow(" H:mm:ss") << 17112876ms << "H:mm:ss" << "4:45:12"; + QTest::newRow("HH:mm:ss") << 17112876ms << "HH:mm:ss" << "04:45:12"; + QTest::newRow(" H:mm:ss oflow") << 1169112876ms << "H:mm:ss" << "324:45:12"; + QTest::newRow("HH:mm:ss oflow") << 1169112876ms << "HH:mm:ss" << "324:45:12"; + + QTest::newRow("HH:mm:ss.") << 17112876ms << "HH:mm:ss." << "04:45:12."; + QTest::newRow("HH:mm:ss.z") << 17112876ms << "HH:mm:ss.z" << "04:45:12.8"; + QTest::newRow("HH:mm:ss.zz") << 17112876ms << "HH:mm:ss.zz" << "04:45:12.87"; + QTest::newRow("HH:mm:ss.zzz") << 17112876ms << "HH:mm:ss.zzz" << "04:45:12.876"; + QTest::newRow("HH:mm:ss.000") << 17112000ms << "HH:mm:ss.zzz" << "04:45:12.000"; + QTest::newRow("HH:mm:ss.05") << 17112050ms << "HH:mm:ss.zz" << "04:45:12.05"; + + // Precison maxes out at 3. This is a millisecond function. + QTest::newRow("HH:mm:ss.zzzzzz")<< 17112876ms << "HH:mm:ss.zzzzzz" << "04:45:12.876"; + QTest::newRow("silly overflow") << 1169112876ms << "HHHHHHHH:mm:ss.z" << "00000324:45:12.8"; + QTest::newRow("random chars") << 1169112876ms << "!HH@mm#ss%zzzzzz" << "!324@45#12%876"; +} + +void TestMythDate::formatting(void) +{ + QFETCH(std::chrono::milliseconds, msecs); + QFETCH(QString, fmt); + QFETCH(QString, expected); + + QString actual = MythDate::formatTime(std::chrono::milliseconds(msecs), fmt); + QCOMPARE(actual, expected); +} + +QTEST_APPLESS_MAIN(TestMythDate) diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.h mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.h --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.h 1970-01-01 00:00:00.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.h 2022-03-25 17:00:15.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Class TestMythDate + * + * Copyright (c) David Hampton 2022 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include "mythdate.h" + +class TestMythDate : public QObject +{ + Q_OBJECT + + private slots: + static void formatting_data(void); + static void formatting(void); +}; diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.pro mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.pro --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.pro 1970-01-01 00:00:00.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythbase/test/test_mythdate/test_mythdate.pro 2022-03-25 17:00:15.000000000 +0000 @@ -0,0 +1,20 @@ +include ( ../../../../settings.pro ) +include ( ../../../../test.pro ) + +QT += testlib + +TEMPLATE = app +TARGET = test_mythdate +DEPENDPATH += . ../.. +INCLUDEPATH += . ../.. +LIBS += -L../.. -lmythbase-$$LIBVERSION +LIBS += -Wl,$$_RPATH_$${PWD}/../.. + +# Input +HEADERS += test_mythdate.h +SOURCES += test_mythdate.cpp + +QMAKE_CLEAN += $(TARGET) +QMAKE_CLEAN += ; ( cd $(OBJECTS_DIR) && rm -f *.gcov *.gcda *.gcno ) + +LIBS += $$EXTRA_LIBS $$LATE_LIBS diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythmetadata/lyricsdata.h mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythmetadata/lyricsdata.h --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythmetadata/lyricsdata.h 2022-02-25 00:05:05.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythmetadata/lyricsdata.h 2022-03-25 17:00:15.000000000 +0000 @@ -38,8 +38,7 @@ private: QString formatTime(void) const { - QString timestr = MythDate::formatTime(m_time,"mm:ss.zzz"); - timestr.chop(1); // Chop 1 to return hundredths + QString timestr = MythDate::formatTime(m_time,"mm:ss.zz"); return QString("[%1]").arg(timestr); } }; diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/Bluray/mythbdbuffer.cpp mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/Bluray/mythbdbuffer.cpp --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/Bluray/mythbdbuffer.cpp 2022-02-25 00:05:06.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/Bluray/mythbdbuffer.cpp 2022-03-25 17:00:15.000000000 +0000 @@ -719,8 +719,7 @@ m_titlesize = bd_get_title_size(m_bdnav); uint32_t chapter_count = GetNumChapters(); auto total_msecs = duration_cast(m_currentTitleLength); - auto duration = MythDate::formatTime(total_msecs, "HH:mm:ss.zzz"); - duration.chop(2); // Chop 2 to show tenths + auto duration = MythDate::formatTime(total_msecs, "HH:mm:ss.z"); LOG(VB_GENERAL, LOG_INFO, LOC + QString("New title info: Index %1 Playlist: %2 Duration: %3 ""Chapters: %5") .arg(m_currentTitle).arg(m_currentTitleInfo->playlist).arg(duration).arg(chapter_count)); LOG(VB_GENERAL, LOG_INFO, LOC + QString("New title info: Clips: %1 Angles: %2 Title Size: %3 Frame Rate %4") diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/decoders/avformatdecoder.cpp mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/decoders/avformatdecoder.cpp --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/decoders/avformatdecoder.cpp 2022-02-25 00:05:05.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/decoders/avformatdecoder.cpp 2022-03-25 17:00:15.000000000 +0000 @@ -4133,7 +4133,9 @@ QString forcedString = forced ? QObject::tr(" (forced)") : ""; int av_index = m_tracks[type][TrackNo].m_av_stream_index; - AVStream *stream = m_ic->streams[av_index]; + AVStream *stream { nullptr }; + if (av_index >= 0 && av_index < m_ic->nb_streams) + stream = m_ic->streams[av_index]; AVDictionaryEntry *entry = stream ? av_dict_get(stream->metadata, "title", NULL, 0) : nullptr; QString user_title = entry ? QString(R"( "%1")").arg(entry->value) : ""; diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/mythplayer.cpp mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/mythplayer.cpp --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/mythplayer.cpp 2022-02-25 00:05:05.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/mythplayer.cpp 2022-03-25 17:00:15.000000000 +0000 @@ -253,7 +253,7 @@ { QMutexLocker locker(&m_playingLock); - if (wait_in_msec != 0ms) + if (wait_in_msec == 0ms) return m_playing; MythTimer t; @@ -833,15 +833,10 @@ return false; } - // Make sure we have at least one frame available. The EOF case - // can get here without one. - if (!m_videoOutput->ValidVideoFrames()) - return false; - if (!m_avSync.GetAVSyncAudioPause()) m_audio.Pause(false); SetBuffering(false); - return true; + return m_videoOutput->ValidVideoFrames(); } void MythPlayer::VideoEnd(void) diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/mythplayerui.cpp mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/mythplayerui.cpp --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/mythplayerui.cpp 2022-02-25 00:05:05.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/mythplayerui.cpp 2022-03-25 17:00:15.000000000 +0000 @@ -239,13 +239,23 @@ return; } - bool videoDrained = - m_videoOutput && m_videoOutput->ValidVideoFrames() < 1; - bool audioDrained = - !m_audio.GetAudioOutput() || - m_audio.IsPaused() || - m_audio.GetAudioOutput()->GetAudioBufferedTime() < 100ms; - if (eof != kEofStateDelayed || (videoDrained && audioDrained)) + bool drained = false; + if (FlagIsSet(kVideoIsNull) || FlagIsSet(kMusicChoice)) + { + // We have audio only or mostly audio content. Exit when + // the audio is drained. + drained = + !m_audio.GetAudioOutput() || + m_audio.IsPaused() || + m_audio.GetAudioOutput()->GetAudioBufferedTime() < 100ms; + } + else + { + // We have normal or video only content. Exit when the + // video is drained. + drained = m_videoOutput && !m_videoOutput->ValidVideoFrames(); + } + if (eof != kEofStateDelayed || drained) { if (eof == kEofStateDelayed) { diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/recorders/satiprtsp.cpp mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/recorders/satiprtsp.cpp --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/libs/libmythtv/recorders/satiprtsp.cpp 2022-02-25 00:05:05.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/libs/libmythtv/recorders/satiprtsp.cpp 2022-03-25 17:00:15.000000000 +0000 @@ -188,7 +188,7 @@ LOG(VB_RECORD, LOG_DEBUG, LOC2 + "PLAY"); QUrl url = QUrl(m_requestUrl); - url.setQuery(""); + url.setQuery(QString()); url.setPath(QString("/stream=%1").arg(m_streamid)); QString pids_str = QString("pids=%1").arg(!pids.empty() ? pids.join(",") : "none"); @@ -417,7 +417,7 @@ QUrl url = QUrl(m_requestUrl); url.setPath("/"); - url.setQuery(""); + url.setQuery(QString()); sendMessage(url, "OPTIONS"); } diff -Nru mythtv-32.0+fixes.20220224.56275b303b/mythtv/programs/mythcommflag/CommDetector2.cpp mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/programs/mythcommflag/CommDetector2.cpp --- mythtv-32.0+fixes.20220224.56275b303b/mythtv/programs/mythcommflag/CommDetector2.cpp 2022-02-25 00:05:06.000000000 +0000 +++ mythtv-32.0+fixes.20220325.f69ce764b7/mythtv/programs/mythcommflag/CommDetector2.cpp 2022-03-25 17:00:15.000000000 +0000 @@ -252,23 +252,20 @@ { auto ms = millisecondsFromFloat(frameno / fps * 1000); auto secs = std::chrono::ceil(ms); - return MythDate::formatTime(secs, "hh:mm:ss"); + return MythDate::formatTime(secs, "HH:mm:ss"); } QString frameToTimestampms(long long frameno, float fps) { auto ms = millisecondsFromFloat(frameno / fps * 1000); - QString timestr = MythDate::formatTime(ms, "mm:ss.zzz"); - timestr.chop(1); // Chop 1 to return hundredths + QString timestr = MythDate::formatTime(ms, "mm:ss.zz"); return timestr; } QString strftimeval(std::chrono::microseconds usecs) { auto msecs = duration_cast(usecs); - return QString("%1.%2") - .arg(duration_cast(usecs).count()) - .arg((msecs % 1s).count(), 3, 10, QChar(QChar('0'))); + return MythDate::formatTime(msecs, "s.zzz"); } }; /* namespace */