comparison avidec.c @ 4550:a36f9f2eefcb libavformat

Fix raw rgb/bgr vertical flip in avi based on info from http://www.fourcc.org/fccbihgt.php. partially fixes issue862.
author michael
date Sat, 21 Feb 2009 15:32:56 +0000
parents a65e3b37f87e
children da2be12b7b4b
comparison
equal deleted inserted replaced
4549:629bcd779fb8 4550:a36f9f2eefcb
449 url_fskip(pb, size); 449 url_fskip(pb, size);
450 break; 450 break;
451 } 451 }
452 get_le32(pb); /* size */ 452 get_le32(pb); /* size */
453 st->codec->width = get_le32(pb); 453 st->codec->width = get_le32(pb);
454 st->codec->height = get_le32(pb); 454 st->codec->height = (int32_t)get_le32(pb);
455 get_le16(pb); /* panes */ 455 get_le16(pb); /* panes */
456 st->codec->bits_per_coded_sample= get_le16(pb); /* depth */ 456 st->codec->bits_per_coded_sample= get_le16(pb); /* depth */
457 tag1 = get_le32(pb); 457 tag1 = get_le32(pb);
458 get_le32(pb); /* ImageSize */ 458 get_le32(pb); /* ImageSize */
459 get_le32(pb); /* XPelsPerMeter */ 459 get_le32(pb); /* XPelsPerMeter */
497 #endif 497 #endif
498 st->codec->codec_type = CODEC_TYPE_VIDEO; 498 st->codec->codec_type = CODEC_TYPE_VIDEO;
499 st->codec->codec_tag = tag1; 499 st->codec->codec_tag = tag1;
500 st->codec->codec_id = codec_get_id(codec_bmp_tags, tag1); 500 st->codec->codec_id = codec_get_id(codec_bmp_tags, tag1);
501 st->need_parsing = AVSTREAM_PARSE_HEADERS; // This is needed to get the pict type which is necessary for generating correct pts. 501 st->need_parsing = AVSTREAM_PARSE_HEADERS; // This is needed to get the pict type which is necessary for generating correct pts.
502
503 if(st->codec->codec_tag==0 && st->codec->height > 0 && st->codec->extradata_size < 1U<<30){
504 st->codec->extradata_size+= 9;
505 st->codec->extradata= av_realloc(st->codec->extradata, st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
506 if(st->codec->extradata)
507 memcpy(st->codec->extradata + st->codec->extradata_size - 9, "BottomUp", 9);
508 }
509 st->codec->height= FFABS(st->codec->height);
510
502 // url_fskip(pb, size - 5 * 4); 511 // url_fskip(pb, size - 5 * 4);
503 break; 512 break;
504 case CODEC_TYPE_AUDIO: 513 case CODEC_TYPE_AUDIO:
505 get_wav_header(pb, st->codec, size); 514 get_wav_header(pb, st->codec, size);
506 if(ast->sample_size && st->codec->block_align && ast->sample_size != st->codec->block_align){ 515 if(ast->sample_size && st->codec->block_align && ast->sample_size != st->codec->block_align){