In the former (data_receiver), it throws an error if max_buflen < 0. This error can never be thrown because in consumerqueue it asserts that `size`, which is provided by max_buflen, is greater than 1 -- yet there's no message to explain the problem.
So how should we clean this up?
Have consumer_queue assert throw an error with a useful message?
Add an error to lsl_create_inlet so it's raised earlier in the chain?
max(max_buflen, 2) to make sure it's always big enough; but probably if someone is only buffering 2 samples then that's by accident and this solution hides the problem silently.
During the
data_receiver
creation, it initializesconsumer_queue sample_queue_
withmax_buflen
here.In the former (data_receiver), it throws an error if max_buflen < 0. This error can never be thrown because in consumerqueue it asserts that `size`, which is provided by max_buflen, is greater than 1 -- yet there's no message to explain the problem.
So how should we clean this up?
consumer_queue
assert throw an error with a useful message?