History

In ipod/mov/mp4 muxer, always write esds descriptor length using 4 bytes, ipod shuffle doesn't support anything else.

Baptiste Coudurier committed 15 years ago

Commit 93dfda81 parent da3534b4 files · +9 −17Browse files

Unified · Split

4 files
  1. libavformat/movenc.c +3 −11
  2. tests/ref/lavf/mov +2 −2
  3. tests/ref/vsynth1/mpeg4 +2 −2
  4. tests/ref/vsynth2/mpeg4 +2 −2
libavformat/movenc.c+3−11
@@ -238,16 +238,9 @@ static int mov_write_enda_tag(AVIOContext *pb) · 237 unmodified lines
238238 return 10;
239239 }
240240
241−static unsigned int descrLength(unsigned int len)
242−{
243− int i;
244− for(i=1; len>>(7*i); i++);
245− return len + 1 + i;
246−}
247−
248241 static void putDescr(AVIOContext *pb, int tag, unsigned int size)
249242 {
250− int i= descrLength(size) - size - 2;
243+ int i = 3;
251244 avio_w8(pb, tag);
252245 for(; i>0; i--)
253246 avio_w8(pb, (size>>(7*i)) | 0x80);
@@ -257,15 +250,14 @@ static void putDescr(AVIOContext *pb, int tag, unsigned int size) · 3 unmodified lines
257250 static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
258251 {
259252 int64_t pos = avio_tell(pb);
260− int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0;
253+ int decoderSpecificInfoLen = track->vosLen ? 5+track->vosLen : 0;
261254
262255 avio_wb32(pb, 0); // size
263256 ffio_wfourcc(pb, "esds");
264257 avio_wb32(pb, 0); // Version
265258
266259 // ES descriptor
267− putDescr(pb, 0x03, 3 + descrLength(13 + decoderSpecificInfoLen) +
268− descrLength(1));
260+ putDescr(pb, 0x03, 3 + 5+13 + decoderSpecificInfoLen + 5+1);
269261 avio_wb16(pb, track->trackID);
270262 avio_w8(pb, 0x00); // flags (= no flags)
271263
tests/ref/lavf/mov+2−2
@@ -1,3 +1,3 @@
1−c145305a775eb2de43cdf94eb1ab5240 *./tests/data/lavf/lavf.mov
2−357669 ./tests/data/lavf/lavf.mov
1+439684b82ccc1fdd24a23392c238ae53 *./tests/data/lavf/lavf.mov
2+357681 ./tests/data/lavf/lavf.mov
33 ./tests/data/lavf/lavf.mov CRC=0x2f6a9b26
tests/ref/vsynth1/mpeg4+2−2
@@ -1,4 +1,4 @@
1−fd83f2ef5887a62b4d755d7cb5f0ac59 *./tests/data/vsynth1/odivx.mp4
2−540144 ./tests/data/vsynth1/odivx.mp4
1+080e75117f8142001b096cd977ba287e *./tests/data/vsynth1/odivx.mp4
2+540156 ./tests/data/vsynth1/odivx.mp4
33 8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv
44 stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200
tests/ref/vsynth2/mpeg4+2−2
@@ -1,4 +1,4 @@
1−47de227982e77830a2db278214a08773 *./tests/data/vsynth2/odivx.mp4
2−119797 ./tests/data/vsynth2/odivx.mp4
1+8ffbe8ce43fe126b12cf9621717d641b *./tests/data/vsynth2/odivx.mp4
2+119809 ./tests/data/vsynth2/odivx.mp4
33 90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv
44 stddev: 5.34 PSNR: 33.57 MAXDIFF: 83 bytes: 7603200/ 7603200

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t