[MPlayer-cvslog] r22477 - trunk/libvo/vo_directx.c

reimar subversion at mplayerhq.hu
Tue Mar 6 12:34:06 CET 2007


Author: reimar
Date: Tue Mar  6 12:34:06 2007
New Revision: 22477

Modified:
   trunk/libvo/vo_directx.c

Log:
Simplify config by using code available in video_out.c


Modified: trunk/libvo/vo_directx.c
==============================================================================
--- trunk/libvo/vo_directx.c	(original)
+++ trunk/libvo/vo_directx.c	Tue Mar  6 12:34:06 2007
@@ -1271,8 +1271,6 @@ static int
 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t options, char *title, uint32_t format)
 {
     RECT rd;
-    vo_screenwidth = monitor_rect.right - monitor_rect.left;
-    vo_screenheight = monitor_rect.bottom - monitor_rect.top;
     vo_fs = options & 0x01;
 	image_format =  format;
 	image_width = width;
@@ -1280,22 +1278,10 @@ config(uint32_t width, uint32_t height, 
 	d_image_width = d_width;
 	d_image_height = d_height;
     if(format != primary_image_format)nooverlay = 0;
-    aspect_save_orig(image_width,image_height);
-    aspect_save_prescale(d_image_width,d_image_height);
-    if(vidmode){
-	    vo_screenwidth=vm_width;
-	    vo_screenheight=vm_height;
-    }	
-	aspect_save_screenres(vo_screenwidth,vo_screenheight);
-    aspect(&d_image_width, &d_image_height, A_NOZOOM);
     window_aspect= (float)d_image_width / (float)d_image_height;
-    vo_dx = 0;
-    vo_dy = 0;   
 
 #ifdef HAVE_NEW_GUI
     if(use_gui){
-        vo_dwidth = d_image_width;
-        vo_dheight = d_image_height;
         guiGetEvent(guiSetShVideo, 0);
     }
 #endif
@@ -1314,11 +1300,7 @@ config(uint32_t width, uint32_t height, 
     mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>overlay surfaces released\n");
 
     if(!vidmode){
-        if(vo_geometry){
-            vo_dx= ( vo_screenwidth - d_image_width ) / 2; vo_dy=( vo_screenheight - d_image_height ) / 2;    
-            geometry(&vo_dx, &vo_dy, &d_image_width, &d_image_height, vo_screenwidth, vo_screenheight);
-        }
-        else {
+        if(!vo_geometry){
             GetWindowRect(hWnd,&rd);
             vo_dx=rd.left;
             vo_dy=rd.top;
@@ -1584,6 +1566,16 @@ static int control(uint32_t request, voi
 		va_end(ap);
 		return color_ctrl_get(data, value);
 	}
+    case VOCTRL_UPDATE_SCREENINFO:
+        if (vidmode) {
+            vo_screenwidth = vm_width;
+            vo_screenheight = vm_height;
+        } else {
+            vo_screenwidth = monitor_rect.right - monitor_rect.left;
+            vo_screenheight = monitor_rect.bottom - monitor_rect.top;
+        }
+        aspect_save_screenres(vo_screenwidth, vo_screenheight);
+        return VO_TRUE;
     case VOCTRL_RESET:
         last_rect.left = 0xDEADC0DE;   // reset window position cache
         // fall-through intended



More information about the MPlayer-cvslog mailing list