On Mon Nov 14 12:05:16 2022 +0000, Rémi Bernon wrote:
I don't think we need to check it here anymore with the latest version. Deselected streams will never have pending read requests (or they will shortly complete it after deselection, with either error or a last sample).
I guess, but it depends on the fact that "read_result" is zero-initialized and never written, which seems non-obvious and a little fragile. In fact, I think it can already break if a stream was selected and then later becomes deselected, even if the filter was stopped in between. Checking "stream->read_requested" would be more obvious but I think still broken for the same reasons (but simple enough to fix.)
Note that if you do that then read_result becomes superfluous and doesn't really need to be stored anywhere.