demux_mkv: concatenate multiple tags

Instead of just picking the last tag that was encountered. The order of
the tags still depends on the file order.

This is probably wrong, and we should respect TargetTypeValue. But
despite staring at the spec, I have no idea what the hell this should
do, so fuck that.

Fixes: #7604
This commit is contained in:
wm4 2020-04-13 16:28:15 +02:00
parent 56cac2be46
commit 30855638df
1 changed files with 8 additions and 2 deletions

View File

@ -1103,8 +1103,14 @@ static void process_tags(demuxer_t *demuxer)
if (dst) {
for (int j = 0; j < tag.n_simple_tag; j++) {
if (tag.simple_tag[j].tag_name && tag.simple_tag[j].tag_string) {
mp_tags_set_str(dst, tag.simple_tag[j].tag_name,
tag.simple_tag[j].tag_string);
char *name = tag.simple_tag[j].tag_name;
char *val = tag.simple_tag[j].tag_string;
char *old = mp_tags_get_str(dst, name);
if (old)
val = talloc_asprintf(NULL, "%s / %s", old, val);
mp_tags_set_str(dst, name, val);
if (old)
talloc_free(val);
}
}
}