From: Peter Ross <[email protected]>

These tags describe the product and quicktime library version respectively.
Originate from Adobe Premier, but some other products use them.

Signed-off-by: Vittorio Giovara <[email protected]>
---
 libavformat/mov.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index fbc8a3e..34e3def 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -251,6 +251,17 @@ static int mov_metadata_loci(MOVContext *c, AVIOContext 
*pb, unsigned len)
     return av_dict_set(&c->fc->metadata, key, buf, 0);
 }
 
+static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
+                            unsigned len, const char *key)
+{
+    char *value = av_malloc(len + 1);
+    if (!value)
+        return AVERROR(ENOMEM);
+    avio_read(pb, value, len);
+    value[len] = 0;
+    return av_dict_set(&c->fc->metadata, key, value, AV_DICT_DONT_STRDUP_VAL);
+}
+
 static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 #ifdef MOV_EXPORT_ALL_METADATA
@@ -263,6 +274,10 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
     int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL;
 
     switch (atom.type) {
+    case MKTAG( '@', 'P', 'R', 'M'):
+        return mov_metadata_raw(c, pb, atom.size, "premiere_version");
+    case MKTAG( '@', 'P', 'R', 'Q'):
+        return mov_metadata_raw(c, pb, atom.size, "quicktime_version");
     case MKTAG( 'a', 'A', 'R', 'T'): key = "album_artist";          break;
     case MKTAG( 'c', 'p', 'r', 't'): key = "copyright";             break;
     case MKTAG( 'd', 'e', 's', 'c'): key = "description";           break;
-- 
1.9.3 (Apple Git-50)

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

Reply via email to