From 1560b667143c321d1baaa784e4cfe9f01bd796b6 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 13 Jun 2008 11:30:36 +0000 Subject: [PATCH] Calculate ftyp size instead of hardcoding it. Originally committed as revision 13763 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/movenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 57cbc56c91..5337c120b9 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -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)