On Fri Nov 11 00:26:24 2022 +0000, Zebediah Figura wrote:
Why are we using a separate delivery thread, instead of reusing read_thread?
First because it's how it's supposed to be. Second, because `OnSample` callbacks may block. For instance on preroll, waiting for each stream to get a sample.
We need the read threads to always be running and returning their next sample because we then deliver them in PTS order. If one read thread is blocked while delivering its sample, the callback thread would be waiting for it indefinitely and wouldn't be able to decide which stream is first.