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
238 return 10;238 return 10;
239}239}
240 240
241static 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
248static void putDescr(AVIOContext *pb, int tag, unsigned int size)241static void putDescr(AVIOContext *pb, int tag, unsigned int size)
249{242{
250 int i= descrLength(size) - size - 2;243 int i = 3;
251 avio_w8(pb, tag);244 avio_w8(pb, tag);
252 for(; i>0; i--)245 for(; i>0; i--)
253 avio_w8(pb, (size>>(7*i)) | 0x80);246 avio_w8(pb, (size>>(7*i)) | 0x80);
@@ -257,15 +250,14 @@ static void putDescr(AVIOContext *pb, int tag, unsigned int size) · 3 unmodified lines
257static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic250static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
258{251{
259 int64_t pos = avio_tell(pb);252 int64_t pos = avio_tell(pb);
260 int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0;253 int decoderSpecificInfoLen = track->vosLen ? 5+track->vosLen : 0;
261 254
262 avio_wb32(pb, 0); // size255 avio_wb32(pb, 0); // size
263 ffio_wfourcc(pb, "esds");256 ffio_wfourcc(pb, "esds");
264 avio_wb32(pb, 0); // Version257 avio_wb32(pb, 0); // Version
265 258
266 // ES descriptor259 // ES descriptor
267 putDescr(pb, 0x03, 3 + descrLength(13 + decoderSpecificInfoLen) +260 putDescr(pb, 0x03, 3 + 5+13 + decoderSpecificInfoLen + 5+1);
268 descrLength(1));
269 avio_wb16(pb, track->trackID);261 avio_wb16(pb, track->trackID);
270 avio_w8(pb, 0x00); // flags (= no flags)262 avio_w8(pb, 0x00); // flags (= no flags)
271 263
tests/ref/lavf/mov+2−2
@@ -1,3 +1,3 @@
1c145305a775eb2de43cdf94eb1ab5240 *./tests/data/lavf/lavf.mov1439684b82ccc1fdd24a23392c238ae53 *./tests/data/lavf/lavf.mov
2357669 ./tests/data/lavf/lavf.mov2357681 ./tests/data/lavf/lavf.mov
3./tests/data/lavf/lavf.mov CRC=0x2f6a9b263./tests/data/lavf/lavf.mov CRC=0x2f6a9b26
tests/ref/vsynth1/mpeg4+2−2
@@ -1,4 +1,4 @@
1fd83f2ef5887a62b4d755d7cb5f0ac59 *./tests/data/vsynth1/odivx.mp41080e75117f8142001b096cd977ba287e *./tests/data/vsynth1/odivx.mp4
2540144 ./tests/data/vsynth1/odivx.mp42540156 ./tests/data/vsynth1/odivx.mp4
38828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv38828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv
4stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 76032004stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200
tests/ref/vsynth2/mpeg4+2−2
@@ -1,4 +1,4 @@
147de227982e77830a2db278214a08773 *./tests/data/vsynth2/odivx.mp418ffbe8ce43fe126b12cf9621717d641b *./tests/data/vsynth2/odivx.mp4
2119797 ./tests/data/vsynth2/odivx.mp42119809 ./tests/data/vsynth2/odivx.mp4
390a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv390a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv
4stddev: 5.34 PSNR: 33.57 MAXDIFF: 83 bytes: 7603200/ 76032004stddev: 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