On Fri Nov 11 21:17:44 2022 +0000, Zebediah Figura wrote:
Hmm, I never tested selecting streams while running. If that's supposed to work it may be better just to leave it as is.
Yeah, starting / stopping threads dynamically didn't seem like a good idea and it's easier to check the correctness with all stream threads started on open / stopped on close.
So instead I keep the thread running but only emit read requests to selected streams. When a stream is deselected, eventually dynamically, it will either fail its read request with `NS_E_NO_MORE_SAMPLES`, or returns a last sample if that happened before, but will then stop receiving read requests.
When a stream is selected again, a read request will be emitted and it will resume reading.