SOUT: implement drain
Currently, draining is done when deleting a sout stream.
Indeed, for the sout case, draining is not handled from vlc_input_decoder_Drain() but from vlc_input_decoder_Delete().
This makes the sout drain not interruptible at all since the input_thread_t already reached EOS and vlc_input_decoder_IsEmpty return true for the sout case.
Since we want to postpone any sout rework to VLC 5.0 (mostly, to make Send and the future Drain asynchronous).
I propose that we implement a synchronous drain in sout:
We move draining fromDelto the newDrainon sout stream that need it.We register an interrupt context in sout modules implementingDrainto make the Drain call interruptible.
This is ugly and far from perfect, but I don't see us doing major sout rework since we are already late for VLC 4.0.
rejected: The drain should be asynchronous with a drained callback.
This will make transcode and the future whisper sout !4468 (closed) interruptible when reaching the end of stream.