diff mbox series

[FFmpeg-devel,2/2] libavformat/mov: fix udta reading in trak box

Message ID ME3PR01MB56240D3B9F32C0357DACC8CFDA229@ME3PR01MB5624.ausprd01.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel,1/2] avformat/movenc: fix type of 'Title of the content' in udta box | expand

Checks

Context Check Description
andriy/configure_x86 warning Failed to apply patch
andriy/configure_ppc warning Failed to apply patch
andriy/configure_aarch64_jetson warning Failed to apply patch
andriy/configure_armv7_RPi4 warning Failed to apply patch

Commit Message

Wang Chuan Jan. 28, 2022, 3:24 a.m. UTC
if we are reading udta in trak box, the data should go to metadata
of current stream.

Signed-off-by: Wang Chuan <ouchuanm@outlook.com>
---
  libavformat/mov.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

              av_dict_set(&c->fc->metadata, key2, str, 0);
diff mbox series

Patch

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);