From ef77adba3e30b6207c834dd34b8b83a1183b21b5 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 8 Jan 2022 20:27:42 +0100 Subject: [PATCH] sectionsd: replace hardcoded timestamp with BUILT_TIMESTAMP based upon https://github.com/Duckbox-Developers/neutrino-ddt/commit/292cb9e8c23ab20262d006202d1fe667e047bd2e Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b49533d97812e67c804507b01f7fc9660c2bc31 Author: vanhofen Date: 2022-01-08 (Sat, 08 Jan 2022) Origin message was: ------------------ - sectionsd: replace hardcoded timestamp with BUILT_TIMESTAMP based upon https://github.com/Duckbox-Developers/neutrino-ddt/commit/292cb9e8c23ab20262d006202d1fe667e047bd2e ------------------ This commit was generated by Migit --- src/eitd/sectionsd.cpp | 7 +++++-- src/gui/Makefile.am | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index ab16d27a4..b3a5a64bf 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -55,6 +55,9 @@ #include "xmlutil.h" #include "debug.h" +// version.h is located in $(top_builddir) +#include + #include #if ! HAVE_CST_HARDWARE #include @@ -1572,8 +1575,8 @@ void CTimeThread::run() if(first_time) sleep_time = 5; } - /* in case of wrong TDT date, dont send time is set, 1609455600 - 01.01.2021 00:00:00 */ - if(time_ntp || (dvb_time > (time_t) 1609455600)) { + /* in case of wrong TDT date, dont send time is set */ + if(time_ntp || (dvb_time > (time_t) BUILT_TIMESTAMP)) { sendTimeEvent(time_ntp, dvb_time); debug(DEBUG_ERROR, "%s: Time set via %s, going to sleep for %d seconds.", name.c_str(), time_ntp ? "NTP" : first_time ? "DVB (TDT)" : "DVB (TOT)", sleep_time); diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 8803ae864..ed044527a 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -3,6 +3,7 @@ BUILT_SOURCES = version.h version.h: @rm -f $@; \ echo "#define BUILT_DATE \"$$(date)\"" > $@ + echo "#define BUILT_TIMESTAMP \"$$(date +%s)\"" >> $@ @if test -d $(top_srcdir)/.git ; then \ pushd $(top_srcdir) ; \ GITTAG=$$(git tag -l "NI-*" | tail -n1); \