demux_mkv: copy attachments (fonts) from ordered chapter sources

They might be needed for rendering subs from those sources.

Fixes #6009.
This commit is contained in:
Philip Sequeira
2019-06-12 23:34:47 +03:00
committed by Jan Ekström
parent cc38035841
commit a38aa74454
+10
View File
@@ -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);
}