mirror of https://git.ffmpeg.org/ffmpeg.git
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)
Originally committed as revision 2587 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
26f548a7a6
commit
32e7b91af1
|
@ -2300,10 +2300,10 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
|
||||||
width = get_bits(&s->gb, 12);
|
width = get_bits(&s->gb, 12);
|
||||||
height = get_bits(&s->gb, 12);
|
height = get_bits(&s->gb, 12);
|
||||||
s->aspect_ratio_info= get_bits(&s->gb, 4);
|
s->aspect_ratio_info= get_bits(&s->gb, 4);
|
||||||
if(s->codec_id == CODEC_ID_MPEG1VIDEO){
|
if (s->aspect_ratio_info == 0)
|
||||||
aspect= 1.0/mpeg1_aspect[s->aspect_ratio_info];
|
return -1;
|
||||||
if(aspect!=0.0) avctx->sample_aspect_ratio= av_d2q(aspect, 255);
|
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);
|
s->frame_rate_index = get_bits(&s->gb, 4);
|
||||||
if (s->frame_rate_index == 0)
|
if (s->frame_rate_index == 0)
|
||||||
|
|
Loading…
Reference in New Issue