diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-02-10 12:04:23 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-02-10 12:04:23 +0100 |
commit | 97458a2e08d5bf4904553eb76467fb047e4719f4 (patch) | |
tree | 41376d5827a576e7917b98a5ceb4acc9779cae2e /src/input/Edi.cpp | |
parent | 9719087ebcb4bd422c592f994f2e1691191e91d6 (diff) | |
download | dabmux-97458a2e08d5bf4904553eb76467fb047e4719f4.tar.gz dabmux-97458a2e08d5bf4904553eb76467fb047e4719f4.tar.bz2 dabmux-97458a2e08d5bf4904553eb76467fb047e4719f4.zip |
Add timestamp offset to management server for EDI input
Diffstat (limited to 'src/input/Edi.cpp')
-rw-r--r-- | src/input/Edi.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/input/Edi.cpp b/src/input/Edi.cpp index e6a7e3e..2aa776f 100644 --- a/src/input/Edi.cpp +++ b/src/input/Edi.cpp @@ -117,6 +117,7 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size) { // Save stats data in bytes, not in frames m_stats.notifyBuffer(m_frames.size() * size); + m_stats.notifyTimestampOffset(0); EdiDecoder::sti_frame_t sti; if (m_is_prebuffering) { @@ -221,6 +222,7 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size, std::time_t seconds, int utc auto ts_req = EdiDecoder::frame_timestamp_t::from_unix_epoch(seconds, utco, tsta); ts_req += m_tist_delay; const double offset = ts_req.diff_s(m_pending_sti_frame.timestamp); + m_stats.notifyTimestampOffset(offset); if (offset < 0) { // Too far in the future @@ -265,12 +267,12 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size, std::time_t seconds, int utc if (num_discarded_wrong_size > 0) { etiLog.level(warn) << "EDI input " << m_name << ": " << - num_discarded_wrong_size << "packets with wrong size."; + num_discarded_wrong_size << " packets with wrong size."; } if (num_discarded_invalid_ts > 0) { etiLog.level(warn) << "EDI input " << m_name << ": " << - num_discarded_wrong_size << "packets with invalid timestamp."; + num_discarded_wrong_size << " packets with invalid timestamp."; } memset(buffer, 0, size); @@ -298,6 +300,7 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size, std::time_t seconds, int utc auto ts_req = EdiDecoder::frame_timestamp_t::from_unix_epoch(seconds, utco, tsta); ts_req += m_tist_delay; const double offset = m_pending_sti_frame.timestamp.diff_s(ts_req); + m_stats.notifyTimestampOffset(offset); if (-24e-3 < offset and offset <= 0) { if (not m_pending_sti_frame.version_data.version.empty()) { |