From: Hendrik Leppkes <[email protected]>

This atom typically is used for a track title.

Reviewed-by: Baptiste Coudurier
Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/mov.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 04deef6..a607d06 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -482,6 +482,8 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
     AVStream *st;
     uint32_t type;
     uint32_t av_unused ctype;
+    int title_size;
+    char *title_str;
 
     if (c->fc->nb_streams < 1) // meta before first trak
         return 0;
@@ -511,6 +513,17 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
     avio_rb32(pb); /* component flags */
     avio_rb32(pb); /* component flags mask */
 
+    title_size = atom.size - 24;
+    if (title_size > 0) {
+        title_str = av_malloc(title_size + 1); /* Add null terminator */
+        if (!title_str)
+            return AVERROR(ENOMEM);
+        avio_read(pb, title_str, title_size);
+        title_str[title_size] = 0;
+        av_dict_set(&st->metadata, "handler_name", title_str, 0);
+        av_freep(&title_str);
+    }
+
     return 0;
 }
 
-- 
1.7.10

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to