# HG changeset patch # User nicodvb # Date 1147298598 0 # Node ID 22805699b7b16145dc2d78fbf4b358ab114632ec # Parent c459df5e8afd082a8cf98d3f40a35ea11bbb2b44 moved code to set aspect ratio for mpeg12 away from video.c and into decoder files; A/R changes work correctly with -vc mpeg12 diff -r c459df5e8afd -r 22805699b7b1 libmpcodecs/vd_libmpeg2.c --- a/libmpcodecs/vd_libmpeg2.c Wed May 10 22:00:30 2006 +0000 +++ b/libmpcodecs/vd_libmpeg2.c Wed May 10 22:03:18 2006 +0000 @@ -157,6 +157,7 @@ int state=mpeg2_parse (mpeg2dec); int type, use_callback; mp_image_t* mpi_new; + unsigned long pw, ph; switch(state){ case STATE_BUFFER: @@ -170,6 +171,9 @@ } break; case STATE_SEQUENCE: + pw = info->sequence->display_width * info->sequence->pixel_width; + ph = info->sequence->display_height * info->sequence->pixel_height; + if(ph) sh->aspect = (float) pw / (float) ph; // video parameters inited/changed, (re)init libvo: if (info->sequence->width >> 1 == info->sequence->chroma_width && info->sequence->height >> 1 == info->sequence->chroma_height) { diff -r c459df5e8afd -r 22805699b7b1 libmpdemux/video.c --- a/libmpdemux/video.c Wed May 10 22:00:30 2006 +0000 +++ b/libmpdemux/video.c Wed May 10 22:03:18 2006 +0000 @@ -326,7 +326,6 @@ } // printf("picture.fps=%d\n",picture.fps); - sh_video->aspect = mpeg12_aspect_info(&picture); // display info: sh_video->format=picture.mpeg1?0x10000001:0x10000002; // mpeg video sh_video->fps=picture.fps;