changeset 13360:1f09ac7b543a

center the image when screenw & height are set
author faust3
date Fri, 17 Sep 2004 09:56:09 +0000
parents b7418aa5c274
children c9d84342971f
files libvo/vo_cvidix.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_cvidix.c	Fri Sep 17 09:55:50 2004 +0000
+++ b/libvo/vo_cvidix.c	Fri Sep 17 09:56:09 2004 +0000
@@ -40,14 +40,15 @@
 /* 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 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;