Skip to content

Commit 8e04e0d

Browse files
committed
Explicit stream opening in ReceiveDataInChunks
1 parent 1ae3703 commit 8e04e0d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/ReceiveDataInChunks.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ int main(int argc, char **argv) {
1717
// resolve the stream of interest & make an inlet
1818
lsl::stream_inlet inlet(lsl::resolve_stream("name", name).at(0), max_buflen);
1919

20-
inlet.flush();
20+
// Use set_postprocessing to get the timestamps in a common base clock.
21+
// Do not use if this application will record timestamps to disk -- it is better to
22+
// do posthoc synchronization.
23+
inlet.set_postprocessing(lsl::post_ALL);
24+
25+
// Inlet opening is implicit when doing pull_sample or pull_chunk.
26+
// Here we open the stream explicitly because we might be doing
27+
// `flush` only.
28+
inlet.open_stream();
2129

2230
double starttime = lsl::local_clock(), next_display = starttime + 1,
2331
next_reset = starttime + 10;

0 commit comments

Comments
 (0)