[SCM] libav/experimental: print atom info during parsing, patch by Frank Barchard, fbarchard at google dot com

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:48:59 UTC 2013


The following commit has been merged in the experimental branch:
commit 65b875d8fcc2a40cc45b41516c4bec4f90909b20
Author: Frank Barchard <fbarchard at google.com>
Date:   Wed Jul 15 08:57:27 2009 +0000

    print atom info during parsing, patch by Frank Barchard, fbarchard at google dot com
    
    Originally committed as revision 19435 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/tools/qt-faststart.c b/tools/qt-faststart.c
index ff86e56..5c1d850 100644
--- a/tools/qt-faststart.c
+++ b/tools/qt-faststart.c
@@ -80,6 +80,7 @@ int main(int argc, char *argv[])
     unsigned char atom_bytes[ATOM_PREAMBLE_SIZE];
     uint32_t atom_type = 0;
     uint64_t atom_size = 0;
+    uint64_t atom_offset = 0;
     uint64_t last_offset;
     unsigned char *moov_atom;
     unsigned char *ftyp_atom = 0;
@@ -112,20 +113,6 @@ int main(int argc, char *argv[])
         atom_size = (uint32_t)BE_32(&atom_bytes[0]);
         atom_type = BE_32(&atom_bytes[4]);
 
-        if ((atom_type != FREE_ATOM) &&
-            (atom_type != JUNK_ATOM) &&
-            (atom_type != MDAT_ATOM) &&
-            (atom_type != MOOV_ATOM) &&
-            (atom_type != PNOT_ATOM) &&
-            (atom_type != SKIP_ATOM) &&
-            (atom_type != WIDE_ATOM) &&
-            (atom_type != PICT_ATOM) &&
-            (atom_type != UUID_ATOM) &&
-            (atom_type != FTYP_ATOM)) {
-            printf ("encountered non-QT top-level atom (is this a Quicktime file?)\n");
-            break;
-        }
-
         /* keep ftyp atom */
         if (atom_type == FTYP_ATOM) {
             ftyp_atom_size = atom_size;
@@ -144,8 +131,7 @@ int main(int argc, char *argv[])
                 return 1;
             }
             start_offset = ftello(infile);
-            continue;
-        }
+        } else {
 
         /* 64-bit special case */
         if (atom_size == 1) {
@@ -158,6 +144,28 @@ int main(int argc, char *argv[])
             fseeko(infile, atom_size - ATOM_PREAMBLE_SIZE, SEEK_CUR);
         }
     }
+        printf("%c%c%c%c %10"PRIu64" %"PRIu64"\n",
+               (atom_type >> 24) & 255,
+               (atom_type >> 16) & 255,
+               (atom_type >>  8) & 255,
+               (atom_type >>  0) & 255,
+               atom_offset,
+               atom_size);
+        if ((atom_type != FREE_ATOM) &&
+            (atom_type != JUNK_ATOM) &&
+            (atom_type != MDAT_ATOM) &&
+            (atom_type != MOOV_ATOM) &&
+            (atom_type != PNOT_ATOM) &&
+            (atom_type != SKIP_ATOM) &&
+            (atom_type != WIDE_ATOM) &&
+            (atom_type != PICT_ATOM) &&
+            (atom_type != UUID_ATOM) &&
+            (atom_type != FTYP_ATOM)) {
+            printf ("encountered non-QT top-level atom (is this a Quicktime file?)\n");
+            break;
+        }
+        atom_offset += atom_size;
+    }
 
     if (atom_type != MOOV_ATOM) {
         printf ("last atom in file was not a moov atom\n");

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list