This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new c75701a62f lavf/mov: read multi-valued metadata tags
c75701a62f is described below
commit c75701a62f6ee6267b4a1d5c3ec72f13aa799704
Author: Jun Zhao <[email protected]>
AuthorDate: Fri Apr 10 23:05:05 2026 +0800
Commit: Jun Zhao <[email protected]>
CommitDate: Mon Jun 8 02:18:32 2026 +0000
lavf/mov: read multi-valued metadata tags
When a metadata tag (e.g. ©ART) contains multiple values, either as
multiple 'data' child atoms within one tag or as multiple sibling tag
atoms with the same key, only the first value was read.
Fix by joining multiple values with semicolons using AV_DICT_APPEND,
consistent with Ogg Vorbis Comment handling in oggparsevorbis.c, and
reusing the existing 'goto retry' loop that covr already uses.
Also add the missing atom.size -= str_size to correctly track remaining
bytes in the tag atom, matching the covr path.
Limitation: on remux the joined string is written back as a single
value, same lossy behavior as Ogg Vorbis. Lossless round-trip would
require AV_DICT_MULTIKEY support throughout the metadata pipeline.
Fix #22367
Signed-off-by: Jun Zhao <[email protected]>
---
libavformat/mov.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 436ca415c2..997a92dc0b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -580,7 +580,9 @@ retry:
str[str_size] = 0;
}
c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
- av_dict_set(metadata, key, str, 0);
+ if (c->itunes_metadata && av_dict_get(*metadata, key, NULL, 0))
+ av_dict_set(metadata, key, ";", AV_DICT_APPEND);
+ av_dict_set(metadata, key, str, c->itunes_metadata ? AV_DICT_APPEND :
0);
if (*language && strcmp(language, "und")) {
snprintf(key2, sizeof(key2), "%s-%s", key, language);
av_dict_set(metadata, key2, str, 0);
@@ -591,6 +593,18 @@ retry:
c->handbrake_version = 1000000*major + 1000*minor + micro;
}
}
+
+ atom.size -= str_size;
+ av_freep(&str);
+
+ // Read remaining data atoms for multi-valued iTunes tags (e.g.
multiple
+ // artists stored as multiple data atoms within one tag atom),
consistent
+ // with the existing covr path.
+ // Note: multiple sibling tag atoms with the same key (e.g. three
separate
+ // ©ART atoms under ilst) are handled by the AV_DICT_APPEND logic
above,
+ // since mov_read_udta_string() is called once per tag atom.
+ if (c->itunes_metadata && atom.size > 8)
+ goto retry;
}
av_freep(&str);
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]