Mercurial > libavcodec.hg
comparison mpeg12.c @ 7787:681a05d9b04f libavcodec
Ignore the spec, and calculate aspect ratio on width/height.
Fixes issue562 and issue621.
author | michael |
---|---|
date | Wed, 03 Sep 2008 19:04:46 +0000 |
parents | 53fb5eb360d5 |
children | 8195c970d077 |
comparison
equal
deleted
inserted
replaced
7786:0251b288a4a0 | 7787:681a05d9b04f |
---|---|
1265 ff_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num, | 1265 ff_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num, |
1266 ff_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den, | 1266 ff_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den, |
1267 1<<30); | 1267 1<<30); |
1268 //MPEG-2 aspect | 1268 //MPEG-2 aspect |
1269 if(s->aspect_ratio_info > 1){ | 1269 if(s->aspect_ratio_info > 1){ |
1270 if( (s1->pan_scan.width == 0 )||(s1->pan_scan.height == 0) ){ | 1270 //we ignore the spec here as reality does not match the spec, see for example |
1271 // res_change_ffmpeg_aspect.ts and sequence-display-aspect.mpg | |
1272 if( (s1->pan_scan.width == 0 )||(s1->pan_scan.height == 0) || 1){ | |
1271 s->avctx->sample_aspect_ratio= | 1273 s->avctx->sample_aspect_ratio= |
1272 av_div_q( | 1274 av_div_q( |
1273 ff_mpeg2_aspect[s->aspect_ratio_info], | 1275 ff_mpeg2_aspect[s->aspect_ratio_info], |
1274 (AVRational){s->width, s->height} | 1276 (AVRational){s->width, s->height} |
1275 ); | 1277 ); |