sccn / liblsl

C++ lsl library for multi-modal time-synched data transmission over the local network
Other
108 stars 63 forks source link

samples_available does not return the number of samples, only 1 or 0. #97

Closed cboulay closed 3 years ago

cboulay commented 3 years ago

According to the docstring, samples_available() is supposed to return the number of samples in the buffer. https://github.com/sccn/liblsl/blob/1eaaf08ce00fb936c463c029fe91c245560e6891/src/stream_inlet_impl.h#L301-L305

But it returns (std::size_t)(!data_receiver_.empty());, and data_receiver_.empty() returns a boolean sample_queue_.empty(); https://github.com/sccn/liblsl/blob/1eaaf08ce00fb936c463c029fe91c245560e6891/src/data_receiver.h#L71

So samples_available() will only ever return 0 or 1.