From f5d3da024c3b7b1bbff74288449c32035530af6b Mon Sep 17 00:00:00 2001 From: faust3 Date: Fri, 17 Sep 2004 09:56:09 +0000 Subject: center the image when screenw & height are set git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13361 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_cvidix.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libvo/vo_cvidix.c b/libvo/vo_cvidix.c index d45d0e046b..e98c227923 100644 --- a/libvo/vo_cvidix.c +++ b/libvo/vo_cvidix.c @@ -40,14 +40,15 @@ LIBVO_EXTERN(cvidix) /* VIDIX related */ static char *vidix_name; static uint32_t swidth,sheight,sformat; - +/// center video only when screenw & height are set +static uint32_t center=0; static vidix_grkey_t gr_key; static uint32_t setup_vidix(){ int x=vo_dx,y=vo_dy; aspect(&vo_dwidth,&vo_dheight,vo_fs ? A_ZOOM : A_NOZOOM); - if(vo_fs){ + if(vo_fs || center){ if(vo_dwidth <= vo_screenwidth)x = (vo_screenwidth - vo_dwidth)/2; else x=0; if(vo_dheight <= vo_screenheight)y = (vo_screenheight - vo_dheight)/2; @@ -76,6 +77,10 @@ static uint32_t setup_vidix(){ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,uint32_t d_height, uint32_t flags, char *title, uint32_t format){ vo_fs = flags & 0x01; + if(!vo_config_count){ + if(vo_screenwidth && vo_screenheight)center=1; + else mp_msg(MSGT_VO, MSGL_WARN, "vo_cvidix: warn: screenwidth and height not set assuming 640x480\n"); + } if(!vo_screenwidth)vo_screenwidth=640; if(!vo_screenheight)vo_screenheight=480; swidth = width; -- cgit v1.2.3