Skip to content

Commit f801a22

Browse files
authored
Merge pull request #98 from sccn/fix_97
Fixes #97 - samples_available now returns samples_available
2 parents 9b96b95 + b3af300 commit f801a22

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/data_receiver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class data_receiver : public cancellable_registry {
7070
/// Check whether the underlying buffer is empty. This value may be inaccurate.
7171
bool empty() { return sample_queue_.empty(); }
7272

73+
std::size_t samples_available() { return sample_queue_.read_available(); }
74+
7375
/// Flush the queue, return the number of dropped samples
7476
uint32_t flush() noexcept { return sample_queue_.flush(); }
7577

src/stream_inlet_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class stream_inlet_impl {
302302
* Query the current size of the buffer, i.e. the number of samples that are buffered.
303303
* Note that this value may be inaccurate and should not be relied on for program logic.
304304
*/
305-
std::size_t samples_available() { return (std::size_t)(!data_receiver_.empty()); }
305+
std::size_t samples_available() { return data_receiver_.samples_available(); }
306306

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

0 commit comments

Comments
 (0)