comparison mjpeg.c @ 1795:920e6381e1fe libavcodec

2 byte shorter userdata for mpeg4 in the past it was startcode,string,00,7F,startcode now it is startcode,string,stratcode both are mpeg4 compliant, as according to the standard the userdata lasts until the next 00 00 01 (startcode prefix) but some very primitive decoders which simply skip until the first 00 byte and then expect the next valid startcode might fail with the old variant, just a theory though (didnt test if quicktime can decode it now)
author michael
date Sun, 08 Feb 2004 22:52:35 +0000
parents b7340afa261a
children 95612d423fde
comparison
equal deleted inserted replaced
1794:d133b4ad0620 1795:920e6381e1fe
376 if (s->aspect_ratio_info /* && !lossless */) 376 if (s->aspect_ratio_info /* && !lossless */)
377 { 377 {
378 /* JFIF header */ 378 /* JFIF header */
379 put_marker(p, APP0); 379 put_marker(p, APP0);
380 put_bits(p, 16, 16); 380 put_bits(p, 16, 16);
381 put_string(p, "JFIF"); /* this puts the trailing zero-byte too */ 381 put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */
382 put_bits(p, 16, 0x0201); /* v 1.02 */ 382 put_bits(p, 16, 0x0201); /* v 1.02 */
383 put_bits(p, 8, 0); /* units type: 0 - aspect ratio */ 383 put_bits(p, 8, 0); /* units type: 0 - aspect ratio */
384 put_bits(p, 16, s->avctx->sample_aspect_ratio.num); 384 put_bits(p, 16, s->avctx->sample_aspect_ratio.num);
385 put_bits(p, 16, s->avctx->sample_aspect_ratio.den); 385 put_bits(p, 16, s->avctx->sample_aspect_ratio.den);
386 put_bits(p, 8, 0); /* thumbnail width */ 386 put_bits(p, 8, 0); /* thumbnail width */
391 if(!(s->flags & CODEC_FLAG_BITEXACT)){ 391 if(!(s->flags & CODEC_FLAG_BITEXACT)){
392 put_marker(p, COM); 392 put_marker(p, COM);
393 flush_put_bits(p); 393 flush_put_bits(p);
394 ptr = pbBufPtr(p); 394 ptr = pbBufPtr(p);
395 put_bits(p, 16, 0); /* patched later */ 395 put_bits(p, 16, 0); /* patched later */
396 put_string(p, LIBAVCODEC_IDENT); 396 put_string(p, LIBAVCODEC_IDENT, 1);
397 size = strlen(LIBAVCODEC_IDENT)+3; 397 size = strlen(LIBAVCODEC_IDENT)+3;
398 ptr[0] = size >> 8; 398 ptr[0] = size >> 8;
399 ptr[1] = size; 399 ptr[1] = size;
400 } 400 }
401 } 401 }