Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 7 additions & 1 deletion xdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading