gst/typefind/gsttypefindfunctions.c: Make quicktime typefinding work with 64-bit...
authorDavid Schleef <ds@schleef.org>
Sun, 31 Oct 2004 02:09:50 +0000 (02:09 +0000)
committerDavid Schleef <ds@schleef.org>
Sun, 31 Oct 2004 02:09:50 +0000 (02:09 +0000)
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (qt_type_find): Make
quicktime typefinding work with 64-bit offsets.

ChangeLog
gst/typefind/gsttypefindfunctions.c

index e5ecc88..b3a798e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-30  David Schleef  <ds@schleef.org>
+
+       * gst/typefind/gsttypefindfunctions.c: (qt_type_find): Make
+         quicktime typefinding work with 64-bit offsets.
+
 2004-10-30  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * ext/dv/gstdvdec.c: (gst_dvdec_handle_sink_event):
index fd95fb8..3709f81 100644 (file)
@@ -789,6 +789,7 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
   guint8 *data;
   guint tip = 0;
   guint64 offset = 0;
+  guint64 size;
 
   while ((data = gst_type_find_peek (tf, offset, 8)) != NULL) {
     if (strncmp (&data[4], "wide", 4) != 0 &&
@@ -807,9 +808,20 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
       tip = GST_TYPE_FIND_MAXIMUM;
       break;
     }
-    offset += GST_READ_UINT32_BE (data);
-    if (GST_READ_UINT32_BE (data) < 8)
-      break;
+    size = GST_READ_UINT32_BE (data);
+    if (size == 1) {
+      guint8 *sizedata;
+
+      sizedata = gst_type_find_peek (tf, offset + 8, 8);
+      if (sizedata == NULL)
+        break;
+
+      size = GST_READ_UINT64_BE (sizedata);
+    } else {
+      if (size < 8)
+        break;
+    }
+    offset += size;
   }
   if (tip > 0) {
     gst_type_find_suggest (tf, tip, QT_CAPS);