From dc4a9aa2bf2099be95f1e3fdca09533ca9e55e55 Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Mon, 6 Jul 2026 09:00:34 +0200 Subject: [PATCH 1/2] Ignore empty samples in string streams --- xdf.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xdf.cpp b/xdf.cpp index 21e1dbb..17fff7a 100644 --- a/xdf.cpp +++ b/xdf.cpp @@ -422,7 +422,13 @@ int Xdf::load_xdf(std::string filename) char* buffer = new char[length + 1]; file.read(buffer, length); buffer[length] = '\0'; - eventMap.emplace_back(std::make_pair(buffer, ts), index); + // Regular-rate marker streams emit a sample on every + // tick, using an empty string as a "nothing happened" + // placeholder; only non-empty samples are markers. + // Irregular streams only emit samples when something + // actually happens, so every sample is kept. + if (streams[index].info.nominal_srate == 0 || length > 0) + eventMap.emplace_back(std::make_pair(buffer, ts), index); delete[] buffer; } streams[index].last_timestamp = ts; From 0b4f735313044c336a432956070de9f3950c2009 Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Mon, 6 Jul 2026 09:02:34 +0200 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc955d7..c311362 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## [UNRELEASED] · YYYY-MM-DD +### 🔧 Fixed +- Ignore empty samples in regular-rate marker streams ([#61](https://github.com/xdf-modules/libxdf/pull/61) by [Clemens Brunner](https://github.com/cbrnr)) ## [1.0.0] · 2026-07-05 ### 🔧 Fixed