From c24520b7f3651dbd4cbdffe93a187c3d213ff845 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 19 May 2018 18:19:07 +0200 Subject: demux: add a way to destroy the demuxer asynchronously This will enable the player core to terminate the demuxers in a "nicer" way without having to block on network. If it just used demux_free(), it would either have to block on network, or like currently, essentially kill all I/O forcefully. The API is slightly awkward, because demuxer lifetime is bound to its allocation. On the other hand, changing that would also be awkward, and introduce weird in-between states that would have to be handled in tons of places. Currently unused, to be user later. --- demux/demux.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'demux/demux.h') diff --git a/demux/demux.h b/demux/demux.h index f5b203590f..7d2924000a 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -253,6 +253,11 @@ typedef struct { void demux_free(struct demuxer *demuxer); void demux_cancel_and_free(struct demuxer *demuxer); +struct demux_free_async_state; +struct demux_free_async_state *demux_free_async(struct demuxer *demuxer); +void demux_free_async_force(struct demux_free_async_state *state); +bool demux_free_async_finish(struct demux_free_async_state *state); + void demux_add_packet(struct sh_stream *stream, demux_packet_t *dp); void demuxer_feed_caption(struct sh_stream *stream, demux_packet_t *dp); -- cgit v1.2.3