Closed cboulay closed 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
samples_available()
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
(std::size_t)(!data_receiver_.empty());
data_receiver_.empty()
sample_queue_.empty();
So samples_available() will only ever return 0 or 1.
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-L305But it returns
(std::size_t)(!data_receiver_.empty());
, anddata_receiver_.empty()
returns a booleansample_queue_.empty();
https://github.com/sccn/liblsl/blob/1eaaf08ce00fb936c463c029fe91c245560e6891/src/data_receiver.h#L71So samples_available() will only ever return 0 or 1.