aboutsummaryrefslogtreecommitdiffstats
path: root/src/zmq2edi
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-18 18:14:43 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-18 18:14:43 +0200
commitb2c7cdef67aaec1a4a123843aebf3942a73e429b (patch)
treecebbe7aefd307d7076f7c5d72c9c3a51eb1d8d06 /src/zmq2edi
parent9f90d07be34a249a7a0c58ddf40ad85cc3242bbf (diff)
downloaddabmux-b2c7cdef67aaec1a4a123843aebf3942a73e429b.tar.gz
dabmux-b2c7cdef67aaec1a4a123843aebf3942a73e429b.tar.bz2
dabmux-b2c7cdef67aaec1a4a123843aebf3942a73e429b.zip
Avoid negative time intervals in odr-zmq2edi
Diffstat (limited to 'src/zmq2edi')
-rw-r--r--src/zmq2edi/EDISender.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/zmq2edi/EDISender.cpp b/src/zmq2edi/EDISender.cpp
index 2921b3c..38fcae9 100644
--- a/src/zmq2edi/EDISender.cpp
+++ b/src/zmq2edi/EDISender.cpp
@@ -234,8 +234,6 @@ void EDISender::send_eti_frame(uint8_t* p, metadata_t metadata)
const auto t_release = t_frame + milliseconds(tist_delay_ms);
const auto t_now = system_clock::now();
- const auto wait_time = t_release - t_now;
- const auto duration_0 = milliseconds(0);
/*
etiLog.level(debug) << "seconds " << seconds + posix_timestamp_1_jan_2000;
@@ -243,7 +241,8 @@ void EDISender::send_eti_frame(uint8_t* p, metadata_t metadata)
etiLog.level(debug) << "wait " << wait_time.count();
*/
- if (wait_time > duration_0) {
+ if (t_release > t_now) {
+ const auto wait_time = t_release - t_now;
std::this_thread::sleep_for(wait_time);
wait_times.push_back(duration_cast<microseconds>(wait_time).count());
}