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 src/data_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class data_receiver : public cancellable_registry {
/// Check whether the underlying buffer is empty. This value may be inaccurate.
bool empty() { return sample_queue_.empty(); }

std::size_t samples_available() { return sample_queue_.read_available(); }

/// Flush the queue, return the number of dropped samples
uint32_t flush() noexcept { return sample_queue_.flush(); }

Expand Down
2 changes: 1 addition & 1 deletion src/stream_inlet_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class stream_inlet_impl {
* Query the current size of the buffer, i.e. the number of samples that are buffered.
* Note that this value may be inaccurate and should not be relied on for program logic.
*/
std::size_t samples_available() { return (std::size_t)(!data_receiver_.empty()); }
std::size_t samples_available() { return data_receiver_.samples_available(); }

/// Flush the queue, return the number of dropped samples
uint32_t flush() { return data_receiver_.flush(); }
Expand Down