diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-01-07 11:20:48 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-01-07 11:20:48 +0100 |
commit | 69eda096577d7185307081c28e95d81bb6b07f23 (patch) | |
tree | 1952f8cb18a622a25f2023b78182e3205dadc711 /src/input | |
parent | 4d10e86654c47c143473835021bb51a561f0555a (diff) | |
download | dabmux-69eda096577d7185307081c28e95d81bb6b07f23.tar.gz dabmux-69eda096577d7185307081c28e95d81bb6b07f23.tar.bz2 dabmux-69eda096577d7185307081c28e95d81bb6b07f23.zip |
Make EDI input stats consistent with ZMQ when stream absent
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/Edi.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/input/Edi.cpp b/src/input/Edi.cpp index b5301d2..7957bb5 100644 --- a/src/input/Edi.cpp +++ b/src/input/Edi.cpp @@ -121,6 +121,7 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size) etiLog.level(info) << "EDI input " << m_name << " pre-buffering complete."; } memset(buffer, 0, size * sizeof(*buffer)); + m_stats.notifyUnderrun(); return 0; } else if (not m_pending_sti_frame.frame.empty()) { @@ -129,6 +130,7 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size) etiLog.level(debug) << "EDI input " << m_name << " size mismatch: " << m_pending_sti_frame.frame.size() << " received, " << size << " requested"; memset(buffer, 0, size * sizeof(*buffer)); + m_stats.notifyUnderrun(); return 0; } else { @@ -149,6 +151,8 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size) else if (m_frames.try_pop(sti)) { if (sti.frame.size() == 0) { etiLog.level(debug) << "EDI input " << m_name << " empty frame"; + memset(buffer, 0, size * sizeof(*buffer)); + m_stats.notifyUnderrun(); return 0; } else if (sti.frame.size() == size) { @@ -181,6 +185,7 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size) etiLog.level(debug) << "EDI input " << m_name << " size mismatch: " << sti.frame.size() << " received, " << size << " requested"; memset(buffer, 0, size * sizeof(*buffer)); + m_stats.notifyUnderrun(); return 0; } } @@ -204,6 +209,7 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size, std::time_t seconds, int utc if (m_is_prebuffering) { if (m_pending_sti_frame.frame.empty()) { memset(buffer, 0, size); + m_stats.notifyUnderrun(); return 0; } else if (m_pending_sti_frame.frame.size() == size) { |