summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-09-03 19:04:46 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-09-03 19:04:46 +0000
commit395206f6b1e445258cba1bdffb82060939030bb4 (patch)
treee4aff1fa77ed73223bc591c8705c2d86819bd96f /libavcodec/mpeg12.c
parent1c9ff17920563fee8c0383d86f5bed6ed7dcf6d4 (diff)
Ignore the spec, and calculate aspect ratio on width/height.
Fixes issue562 and issue621. Originally committed as revision 15183 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index a7272d506b..966fa48901 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1267,7 +1267,9 @@ static int mpeg_decode_postinit(AVCodecContext *avctx){
1<<30);
//MPEG-2 aspect
if(s->aspect_ratio_info > 1){
- if( (s1->pan_scan.width == 0 )||(s1->pan_scan.height == 0) ){
+ //we ignore the spec here as reality does not match the spec, see for example
+ // res_change_ffmpeg_aspect.ts and sequence-display-aspect.mpg
+ if( (s1->pan_scan.width == 0 )||(s1->pan_scan.height == 0) || 1){
s->avctx->sample_aspect_ratio=
av_div_q(
ff_mpeg2_aspect[s->aspect_ratio_info],