changeset 4724:13ffc02ce5f8 libavformat

search for hdlr atom in meta, some files do not store version+flags
author bcoudurier
date Sun, 15 Mar 2009 23:54:53 +0000
parents a2390c6a35e6
children f2d519837d2d
files mov.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sun Mar 15 20:14:25 2009 +0000
+++ b/mov.c	Sun Mar 15 23:54:53 2009 +0000
@@ -1338,9 +1338,16 @@
 
 static int mov_read_meta(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 {
-    url_fskip(pb, 4); // version + flags
-    atom.size -= 4;
-    return mov_read_default(c, pb, atom);
+    while (atom.size > 8) {
+        uint32_t tag = get_le32(pb);
+        atom.size -= 4;
+        if (tag == MKTAG('h','d','l','r')) {
+            url_fseek(pb, -8, SEEK_CUR);
+            atom.size += 8;
+            return mov_read_default(c, pb, atom);
+        }
+    }
+    return 0;
 }
 
 static int mov_read_trkn(MOVContext *c, ByteIOContext *pb, MOVAtom atom)