summaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-08-12 11:24:32 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-08-12 11:24:32 +0200
commited03106ec4ad126509af35686fe79c9b2574b035 (patch)
treeb3c883df7c70d8c4698efafbc631a5082e1c4d56 /src/input
parent40883fad3ef90ca16d09d36153dd255c531d7333 (diff)
downloaddabmux-ed03106ec4ad126509af35686fe79c9b2574b035.tar.gz
dabmux-ed03106ec4ad126509af35686fe79c9b2574b035.tar.bz2
dabmux-ed03106ec4ad126509af35686fe79c9b2574b035.zip
EDI input: fix timestamps ignored when switching from prebuffering to timestamped
Diffstat (limited to 'src/input')
-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;
+ }
}
}
}