summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-19 18:19:07 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:35 +0200
commitc24520b7f3651dbd4cbdffe93a187c3d213ff845 (patch)
treee964610d84844ff8227da560a444bd1afc345a6e /demux/demux.h
parentee88ae15b3060631d6858fcd180e892883d2c299 (diff)
downloadmpv-c24520b7f3651dbd4cbdffe93a187c3d213ff845.tar.bz2
mpv-c24520b7f3651dbd4cbdffe93a187c3d213ff845.tar.xz
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.
Diffstat (limited to 'demux/demux.h')
-rw-r--r--demux/demux.h5
1 files changed, 5 insertions, 0 deletions
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);