OSDN Git Service

Calculate ftyp size instead of hardcoding it.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Jun 2008 11:30:36 +0000 (11:30 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Jun 2008 11:30:36 +0000 (11:30 +0000)
Originally committed as revision 13763 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/movenc.c

index 57cbc56..5337c12 100644 (file)
@@ -1377,9 +1377,10 @@ static int mov_write_mdat_tag(ByteIOContext *pb, MOVContext *mov)
 static void mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s)
 {
     MOVContext *mov = s->priv_data;
+    offset_t pos = url_ftell(pb);
     int i;
 
-    put_be32(pb, 0x14); /* size */
+    put_be32(pb, 0); /* size */
     put_tag(pb, "ftyp");
 
     if (mov->mode == MODE_3GP)
@@ -1415,6 +1416,7 @@ static void mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s)
         put_tag(pb, "isom");
     else
         put_tag(pb, "qt  ");
+    return updateSize(pb, pos);
 }
 
 static void mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s)