[FFmpeg-devel] [PATCH 2/2] libavformat/mov: fix udta reading in trak box
Wang Chuan
ouchuanm at outlook.com
Fri Jan 28 05:24:02 EET 2022
if we are reading udta in trak box, the data should go to metadata
of current stream.
Signed-off-by: Wang Chuan <ouchuanm at outlook.com>
---
libavformat/mov.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1437d160f8..cb983defb3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -522,7 +522,10 @@ retry:
str[str_size] = 0;
}
c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
- av_dict_set(&c->fc->metadata, key, str, 0);
+ if (c->trak_index != -1)
+ av_dict_set(&c->fc->streams[c->trak_index]->metadata, key,
str, 0);
+ else
+ av_dict_set(&c->fc->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);
--
2.29.2
More information about the ffmpeg-devel
mailing list