From 3f60548df472d01387784601526e378d8ffb4659 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 3 Mar 2016 18:48:56 +0100 Subject: sub: pass all attachments to the subtitle decoder Commit 8d4a179c made subtitle decoders pick up fonts strictly from the same source file (i.e. the same demuxer). It breaks some fucked up use-case, and 2 people on this earth complained about the change because of this. Add it back. This copies all attached fonts on each subtitle init. I considered converting attachments to use refcounting, but it'd probably be much more complex. Since it's slightly harder to get a list of active demuxers with duplicate removed, the prev_demuxer variable serves as a hack to achieve almost the same thing, except in weird corner cases. (In which fonts could be added twice.) --- sub/dec_sub.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sub/dec_sub.h') diff --git a/sub/dec_sub.h b/sub/dec_sub.h index b3f30520e3..cedb140e79 100644 --- a/sub/dec_sub.h +++ b/sub/dec_sub.h @@ -6,7 +6,6 @@ #include "osd.h" -struct demuxer; struct sh_stream; struct mpv_global; struct demux_packet; @@ -22,8 +21,13 @@ enum sd_ctrl { SD_CTRL_SET_VIDEO_DEF_FPS, }; -struct dec_sub *sub_create(struct mpv_global *global, struct demuxer *demuxer, - struct sh_stream *sh); +struct attachment_list { + struct demux_attachment *entries; + int num_entries; +}; + +struct dec_sub *sub_create(struct mpv_global *global, struct sh_stream *sh, + struct attachment_list *attachments); void sub_destroy(struct dec_sub *sub); void sub_lock(struct dec_sub *sub); void sub_unlock(struct dec_sub *sub); -- cgit v1.2.3