From a38aa74454ba8475463510dc2de8162f39565d11 Mon Sep 17 00:00:00 2001 From: Philip Sequeira Date: Wed, 25 Jul 2018 21:16:59 -0400 Subject: demux_mkv: copy attachments (fonts) from ordered chapter sources They might be needed for rendering subs from those sources. Fixes #6009. --- demux/demux_mkv_timeline.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'demux/demux_mkv_timeline.c') diff --git a/demux/demux_mkv_timeline.c b/demux/demux_mkv_timeline.c index 69cf26e681..1408ddf8f5 100644 --- a/demux/demux_mkv_timeline.c +++ b/demux/demux_mkv_timeline.c @@ -297,6 +297,16 @@ static void find_ordered_chapter_sources(struct tl_ctx *ctx) ctx->num_sources = j; } + // Copy attachments from referenced sources so fonts are loaded for sub + // rendering. + for (int i = 1; i < ctx->num_sources; i++) { + for (int j = 0; j < ctx->sources[i]->num_attachments; j++) { + struct demux_attachment *att = &ctx->sources[i]->attachments[j]; + demuxer_add_attachment(ctx->demuxer, att->name, att->type, + att->data, att->data_size); + } + } + talloc_free(tmp); } -- cgit v1.2.3