aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-03-30 14:08:16 -0700
committerAnton Khirnov <anton@khirnov.net>2011-05-13 07:38:54 +0200
commit7e19a6e86814b08073b4b8873598ef5d94e6345d (patch)
tree87328a764739c2ad74394b81b066dd41ec0d29ab /libavformat/movenc.c
parentdbe94539469b6d5113b37ea45eaf69ddbe34154e (diff)
downloadffmpeg-7e19a6e86814b08073b4b8873598ef5d94e6345d.tar.gz
movenc: always write esds descriptor length using 4 bytes.
ipod shuffle doesn't support anything else. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index bdd92f23b8..52c775a565 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -238,16 +238,9 @@ static int mov_write_enda_tag(AVIOContext *pb)
return 10;
}
-static unsigned int descrLength(unsigned int len)
-{
- int i;
- for(i=1; len>>(7*i); i++);
- return len + 1 + i;
-}
-
static void putDescr(AVIOContext *pb, int tag, unsigned int size)
{
- int i= descrLength(size) - size - 2;
+ int i = 3;
avio_w8(pb, tag);
for(; i>0; i--)
avio_w8(pb, (size>>(7*i)) | 0x80);
@@ -257,15 +250,14 @@ static void putDescr(AVIOContext *pb, int tag, unsigned int size)
static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
{
int64_t pos = avio_tell(pb);
- int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0;
+ int decoderSpecificInfoLen = track->vosLen ? 5+track->vosLen : 0;
avio_wb32(pb, 0); // size
ffio_wfourcc(pb, "esds");
avio_wb32(pb, 0); // Version
// ES descriptor
- putDescr(pb, 0x03, 3 + descrLength(13 + decoderSpecificInfoLen) +
- descrLength(1));
+ putDescr(pb, 0x03, 3 + 5+13 + decoderSpecificInfoLen + 5+1);
avio_wb16(pb, track->trackID);
avio_w8(pb, 0x00); // flags (= no flags)