summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/input/Edi.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/input/Edi.cpp b/src/input/Edi.cpp
index 449c221..a5e6525 100644
--- a/src/input/Edi.cpp
+++ b/src/input/Edi.cpp
@@ -297,16 +297,7 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size, std::time_t seconds, int utc
ts_req += m_tist_delay;
const double offset = m_pending_sti_frame.timestamp.diff_s(ts_req);
- if (offset > 24e-3) {
- m_stats.notifyUnderrun();
- m_is_prebuffering = true;
- m_pending_sti_frame.frame.clear();
- etiLog.level(warn) << "EDI input " << m_name <<
- " timestamp out of bounds, re-enabling pre-buffering";
- memset(buffer, 0, size);
- return 0;
- }
- else {
+ if (-24e-3 < offset and offset <= 0) {
if (not m_pending_sti_frame.version_data.version.empty()) {
m_stats.notifyVersion(
m_pending_sti_frame.version_data.version,
@@ -319,6 +310,15 @@ size_t Edi::readFrame(uint8_t *buffer, size_t size, std::time_t seconds, int utc
m_pending_sti_frame.frame.clear();
return size;
}
+ else {
+ m_stats.notifyUnderrun();
+ m_is_prebuffering = true;
+ m_pending_sti_frame.frame.clear();
+ etiLog.level(warn) << "EDI input " << m_name <<
+ " timestamp out of bounds, re-enabling pre-buffering";
+ memset(buffer, 0, size);
+ return 0;
+ }
}
}
}