aboutsummaryrefslogtreecommitdiffstats
path: root/src/dabOutput/edi
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-03-05 23:29:57 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-03-05 23:29:57 +0100
commit0957760c42cc04d9c295b649b039015186b25609 (patch)
treed142ad6434b459e79359a2ad3121a7f6f68a77f0 /src/dabOutput/edi
parentfd8748e1a9b49f2c6ca83247db97d6bb30a48ef6 (diff)
downloaddabmux-0957760c42cc04d9c295b649b039015186b25609.tar.gz
dabmux-0957760c42cc04d9c295b649b039015186b25609.tar.bz2
dabmux-0957760c42cc04d9c295b649b039015186b25609.zip
Replace clock_gettime with std::chrono for EDI
Diffstat (limited to 'src/dabOutput/edi')
-rw-r--r--src/dabOutput/edi/TagItems.cpp8
-rw-r--r--src/dabOutput/edi/TagItems.h10
2 files changed, 10 insertions, 8 deletions
diff --git a/src/dabOutput/edi/TagItems.cpp b/src/dabOutput/edi/TagItems.cpp
index f3e8404..54e996b 100644
--- a/src/dabOutput/edi/TagItems.cpp
+++ b/src/dabOutput/edi/TagItems.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013,2014 Matthias P. Braendli
+ Copyright (C) 2016 Matthias P. Braendli
http://mpb.li
EDI output.
@@ -131,6 +131,12 @@ std::vector<uint8_t> TagDETI::Assemble()
return packet;
}
+void TagDETI::set_seconds(std::chrono::system_clock::time_point t)
+{
+ std::time_t posix_timestamp_1_jan_2000 = 946684800;
+ seconds = std::chrono::system_clock::to_time_t(t) - posix_timestamp_1_jan_2000;
+}
+
std::vector<uint8_t> TagESTn::Assemble()
{
diff --git a/src/dabOutput/edi/TagItems.h b/src/dabOutput/edi/TagItems.h
index 50d5e99..6a8470b 100644
--- a/src/dabOutput/edi/TagItems.h
+++ b/src/dabOutput/edi/TagItems.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013,2014 Matthias P. Braendli
+ Copyright (C) 2016 Matthias P. Braendli
http://mpb.li
EDI output.
@@ -30,6 +30,7 @@
#include "config.h"
#include "Eti.h"
#include <vector>
+#include <chrono>
#include <string>
#include <stdint.h>
@@ -98,12 +99,7 @@ class TagDETI : public TagItem
*/
uint32_t seconds;
- void set_seconds(struct timespec tv)
- {
- time_t posix_timestamp_1_jan_2000 = 946684800;
- seconds = tv.tv_sec - posix_timestamp_1_jan_2000;
- }
-
+ void set_seconds(std::chrono::system_clock::time_point t);
/* TSTA: Shall be the 24 least significant bits of the Time Stamp
* (TIST) field from the STI-D(LI) Frame. The full definition for the