Description
Grouping a couple errors together so I only have to create 1 PR.
Problem 1:
Since e8817c0, if the sleep duration (default 5 msec) is shorter than the time between two samples in any of the streams, stop_idx
will not be larger than start_idx
and all_streams_exhausted
will remain True
, causing the loop to exit and terminate playback prematurely.
I think the solution is for the streams-exhausted check to be based on (1) looping disabled and (2) the streams' time ranges. This will probably require some new state variables.
Problem 2:
From the playback entry point, one of the arguments to LSLPlaybackClock
is loop_time=wrap_dur if loop else None
, and this value gets assigned to self._boundary
. However, the clock's t0
property tries to do self._n_loop * self._boundary
which doesn't work when loop
is False
and therefore self._boundary
is None
.
The easy solution is to fix the argument to be loop_time=wrap_dur if loop else 0.0
, which is probably the correct solution (vs fixing t0
property) because the loop_time
annotation is non-optional float
.