summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-10 22:03:18 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-10 22:03:18 +0000
commit7c516063dadb3e49856748c337fdb02d5e003c93 (patch)
tree0e65c11c244a3f14a8c7d080d1737ae855d4ee31 /libmpcodecs
parentcef8c72baee64dd00413e6f31ef2049ee1211d33 (diff)
downloadmpv-7c516063dadb3e49856748c337fdb02d5e003c93.tar.bz2
mpv-7c516063dadb3e49856748c337fdb02d5e003c93.tar.xz
moved code to set aspect ratio for mpeg12 away from video.c and into decoder files; A/R changes work correctly with -vc mpeg12
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18429 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_libmpeg2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libmpcodecs/vd_libmpeg2.c b/libmpcodecs/vd_libmpeg2.c
index f07e49614b..3db1ca85f0 100644
--- a/libmpcodecs/vd_libmpeg2.c
+++ b/libmpcodecs/vd_libmpeg2.c
@@ -157,6 +157,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
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 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
}
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) {