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 2018-07-25 21:16:59 -04:00 committed by Jan Ekström
parent cc38035841
commit a38aa74454
1 changed files with 10 additions and 0 deletions

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);
}