[FFmpeg-cvslog] r21023 - in trunk/libavformat: isom.h mov.c

bcoudurier subversion
Mon Jan 4 23:51:38 CET 2010


Author: bcoudurier
Date: Mon Jan  4 23:51:38 2010
New Revision: 21023

Log:
remove no more needed MOVAtom.offset field

Modified:
   trunk/libavformat/isom.h
   trunk/libavformat/mov.c

Modified: trunk/libavformat/isom.h
==============================================================================
--- trunk/libavformat/isom.h	Mon Jan  4 23:48:27 2010	(r21022)
+++ trunk/libavformat/isom.h	Mon Jan  4 23:51:38 2010	(r21023)
@@ -64,7 +64,6 @@ typedef struct {
 
 typedef struct {
     uint32_t type;
-    int64_t offset;
     int64_t size; /* total size (excluding the size and type fields) */
 } MOVAtom;
 

Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c	Mon Jan  4 23:48:27 2010	(r21022)
+++ trunk/libavformat/mov.c	Mon Jan  4 23:51:38 2010	(r21023)
@@ -183,8 +183,6 @@ static int mov_read_default(MOVContext *
     int i;
     int err = 0;
 
-    a.offset = atom.offset;
-
     if (atom.size < 0)
         atom.size = INT64_MAX;
     while(((total_size + 8) < atom.size) && !url_feof(pb) && !err) {
@@ -196,12 +194,10 @@ static int mov_read_default(MOVContext *
             a.type = get_le32(pb);
         }
         total_size += 8;
-        a.offset += 8;
         dprintf(c->fc, "type: %08x  %.4s  sz: %"PRIx64"  %"PRIx64"   %"PRIx64"\n",
                 a.type, (char*)&a.type, a.size, atom.size, total_size);
         if (a.size == 1) { /* 64 bit extended size */
             a.size = get_be64(pb) - 8;
-            a.offset += 8;
             total_size += 8;
         }
         if (a.size == 0) {
@@ -238,7 +234,6 @@ static int mov_read_default(MOVContext *
                 url_fskip(pb, left);
         }
 
-        a.offset += a.size;
         total_size += a.size;
     }
 
@@ -862,7 +857,7 @@ static int mov_read_stsd(MOVContext *c, 
         //Parsing Sample description table
         enum CodecID id;
         int dref_id = 1;
-        MOVAtom a = { 0, 0, 0 };
+        MOVAtom a = { 0 };
         int64_t start_pos = url_ftell(pb);
         int size = get_be32(pb); /* size */
         uint32_t format = get_le32(pb); /* data format */
@@ -1935,7 +1930,6 @@ static int mov_read_wide(MOVContext *c, 
         return 0;
     }
     atom.type = get_le32(pb);
-    atom.offset += 8;
     atom.size -= 8;
     if (atom.type != MKTAG('m','d','a','t')) {
         url_fskip(pb, atom.size);
@@ -1981,7 +1975,6 @@ static int mov_read_cmov(MOVContext *c, 
     if(init_put_byte(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)
         goto free_and_return;
     atom.type = MKTAG('m','o','o','v');
-    atom.offset = 0;
     atom.size = moov_len;
 #ifdef DEBUG
 //    { int fd = open("/tmp/uncompheader.mov", O_WRONLY | O_CREAT); write(fd, moov_data, moov_len); close(fd); }
@@ -2133,7 +2126,7 @@ static int mov_read_header(AVFormatConte
     MOVContext *mov = s->priv_data;
     ByteIOContext *pb = s->pb;
     int err;
-    MOVAtom atom = { 0, 0, 0 };
+    MOVAtom atom = { 0 };
 
     mov->fc = s;
     /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */
@@ -2194,7 +2187,7 @@ static int mov_read_packet(AVFormatConte
     if (!sample) {
         mov->found_mdat = 0;
         if (!url_is_streamed(s->pb) ||
-            mov_read_default(mov, s->pb, (MOVAtom){ 0, 0, INT64_MAX }) < 0 ||
+            mov_read_default(mov, s->pb, (MOVAtom){ 0, INT64_MAX }) < 0 ||
             url_feof(s->pb))
             return AVERROR_EOF;
         dprintf(s, "read fragments, offset 0x%llx\n", url_ftell(s->pb));



More information about the ffmpeg-cvslog mailing list