summaryrefslogtreecommitdiffstats
path: root/src/DabMux.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-04-19 00:27:29 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-04-19 00:27:29 +0200
commit2ef42b865cd88f274958bde780c2731e0434eb34 (patch)
tree49e5257b90efd777d4b122821c03fa2277f1e6bf /src/DabMux.cpp
parent9829cd690856e987704996efb52be3c8e1b840cf (diff)
downloaddabmux-2ef42b865cd88f274958bde780c2731e0434eb34.tar.gz
dabmux-2ef42b865cd88f274958bde780c2731e0434eb34.tar.bz2
dabmux-2ef42b865cd88f274958bde780c2731e0434eb34.zip
Add support for automatic local-time-offset
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r--src/DabMux.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 734643c..c090738 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -77,6 +77,8 @@ typedef DWORD32 uint32_t;
# include <net/if_packet.h>
#endif
+#include <time.h>
+
#ifdef _WIN32
# pragma warning ( disable : 4103 )
# include "Eti.h"
@@ -1631,6 +1633,14 @@ int main(int argc, char *argv[])
fig0_9->ext = 0;
fig0_9->lto = 0; // Unique LTO for ensemble
+
+ if (ensemble->lto_auto) {
+ time_t now = time(NULL);
+ struct tm* ltime = localtime(&now);
+ time_t now2 = timegm(ltime);
+ ensemble->lto = (now2 - now) / 1800;
+ }
+
if (ensemble->lto >= 0) {
fig0_9->ensembleLto = ensemble->lto;
}
@@ -1638,6 +1648,7 @@ int main(int argc, char *argv[])
/* Convert to 1-complement representation */
fig0_9->ensembleLto = (-ensemble->lto) | (1<<5);
}
+
fig0_9->ensembleEcc = ensemble->ecc;
fig0_9->tableId = ensemble->international_table;
index += 5;