summaryrefslogtreecommitdiffstats
path: root/demux/demux_mkv.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-13 16:28:15 +0200
committerwm4 <wm4@nowhere>2020-04-13 16:28:15 +0200
commit30855638df313fd2d13739107c2ed39935a52eb3 (patch)
tree53f2a5c1455ead1ddcd0ec301884f6a738fa9c75 /demux/demux_mkv.c
parent56cac2be465d1ca5798ab55eed448393f07ad548 (diff)
downloadmpv-30855638df313fd2d13739107c2ed39935a52eb3.tar.bz2
mpv-30855638df313fd2d13739107c2ed39935a52eb3.tar.xz
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
Diffstat (limited to 'demux/demux_mkv.c')
-rw-r--r--demux/demux_mkv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index bb1125a0f2..6eb48cbeea 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -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);
}
}
}