Commit 28546140 authored by bellard's avatar bellard

fixed potential problem if aspect_ratio_info == 0 for MPEG stream - fixed...

fixed potential problem if aspect_ratio_info == 0 for MPEG stream - fixed aspect ratio problem if CODEC_ID_MPEG2VIDEO is used to decode an MPEG1 stream (which is the recommended codec id for mpeg video)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2587 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ed3ba318
......@@ -2300,10 +2300,10 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
width = get_bits(&s->gb, 12);
height = get_bits(&s->gb, 12);
s->aspect_ratio_info= get_bits(&s->gb, 4);
if(s->codec_id == CODEC_ID_MPEG1VIDEO){
aspect= 1.0/mpeg1_aspect[s->aspect_ratio_info];
if(aspect!=0.0) avctx->sample_aspect_ratio= av_d2q(aspect, 255);
}
if (s->aspect_ratio_info == 0)
return -1;
aspect= 1.0/mpeg1_aspect[s->aspect_ratio_info];
avctx->sample_aspect_ratio= av_d2q(aspect, 255);
s->frame_rate_index = get_bits(&s->gb, 4);
if (s->frame_rate_index == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment