aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-03-30 14:08:16 -0700
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-03-30 14:09:09 -0700
commit93dfda88968c5e4d3f596f35a446fb7c238e96b2 (patch)
tree58ce64869de7865413d803f95c273149c239843e /libavformat
parentda3534b01e00502b202ed3f51ffde12866e5111d (diff)
downloadffmpeg-93dfda88968c5e4d3f596f35a446fb7c238e96b2.tar.gz
In ipod/mov/mp4 muxer, always write esds descriptor length using 4 bytes,
ipod shuffle doesn't support anything else.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b7bffd98b3..fe529179ee 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)