summaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-01-07 11:20:48 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-01-07 11:20:48 +0100
commit69eda096577d7185307081c28e95d81bb6b07f23 (patch)
tree1952f8cb18a622a25f2023b78182e3205dadc711 /src/input
parent4d10e86654c47c143473835021bb51a561f0555a (diff)
downloaddabmux-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.cpp6
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) {