summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-17 18:52:22 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commit287166b02e284051b6839ba7747e1e1f63364b05 (patch)
treea7beafa6de6a080c311debaa7214532420d81e7c /demux/demux.h
parentd9cc13f3118acea4314a13b8472f1f37e1c04805 (diff)
downloadmpv-287166b02e284051b6839ba7747e1e1f63364b05.tar.bz2
mpv-287166b02e284051b6839ba7747e1e1f63364b05.tar.xz
sub: remove only user of demux_read_packet()
There are 3 packet reading functions in the demux API, which all function completely differently. One of them, demux_read_packet(), has only 1 caller, which is in dec_sub.c. Change this caller to use demux_read_packet_async() instead. Since it really wants to do a blocking call, setup some proper waiting. This uses mp_dispatch_queue, because even though it's overkill, it needs the least code. In practice, waiting actually never happens. This code is only called on code paths where everything is already read into memory (libavformat's subtitle demuxers simply behave this way). It's still a bit of a "coincidence", so implement it properly anyway. If suubtitle decoder init fails, we still need to unset the demuxer wakeup callback. Add a sub_destroy() call to the failure path. This also happens to fix a missed pthread_mutex_destroy() call (in practice this was a nop, or a memory leak on BSDs).
Diffstat (limited to 'demux/demux.h')
-rw-r--r--demux/demux.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/demux/demux.h b/demux/demux.h
index b7f75ce813..526c03713e 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -238,7 +238,6 @@ bool demux_free_async_finish(struct demux_free_async_state *state);
void demuxer_feed_caption(struct sh_stream *stream, demux_packet_t *dp);
-struct demux_packet *demux_read_packet(struct sh_stream *sh);
int demux_read_packet_async(struct sh_stream *sh, struct demux_packet **out_pkt);
bool demux_stream_is_selected(struct sh_stream *stream);
void demux_set_stream_wakeup_cb(struct sh_stream *sh,