summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-09-17 09:56:09 +0000
committerfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-09-17 09:56:09 +0000
commitf5d3da024c3b7b1bbff74288449c32035530af6b (patch)
tree3800f91d426b9cd267e6e82fec686e8ddb217523 /libvo
parente064d4ddd4da6f7199c1810b73adf8b4c2121b04 (diff)
downloadmpv-f5d3da024c3b7b1bbff74288449c32035530af6b.tar.bz2
mpv-f5d3da024c3b7b1bbff74288449c32035530af6b.tar.xz
center the image when screenw & height are set
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13361 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_cvidix.c9
1 files 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;