ffmpeg | branch: master | Rémi Bernon <rber...@codeweavers.com> | Wed Jan 15 11:40:17 2025 +0100| [d62fd6e9c89552ede2f07cb7302ac8d326792e59] | committer: Martin Storsjö
avformat/mov: Store trak > udta metadata on each stream Some files keep extra metadata such as 'name' fields within udta, and it is useful for Wine to access them with the "export_all" option so they can then be exposed to Windows applications. Signed-off-by: Rémi Bernon <rber...@codeweavers.com> Signed-off-by: Martin Storsjö <mar...@martin.st> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d62fd6e9c89552ede2f07cb7302ac8d326792e59 --- libavformat/mov.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index e5d988c437..85aef33b19 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -354,6 +354,12 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL; int raw = 0; int num = 0; + AVDictionary **metadata; + + if (c->trak_index >= 0 && c->trak_index < c->fc->nb_streams) + metadata = &c->fc->streams[c->trak_index]->metadata; + else + metadata = &c->fc->metadata; switch (atom.type) { case MKTAG( '@','P','R','M'): key = "premiere_version"; raw = 1; break; @@ -572,10 +578,10 @@ retry: str[str_size] = 0; } c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED; - av_dict_set(&c->fc->metadata, key, str, 0); + av_dict_set(metadata, key, str, 0); if (*language && strcmp(language, "und")) { snprintf(key2, sizeof(key2), "%s-%s", key, language); - av_dict_set(&c->fc->metadata, key2, str, 0); + av_dict_set(metadata, key2, str, 0); } if (!strcmp(key, "encoder")) { int major, minor, micro; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".