[MPlayer-dev-eng] [PATCH] vo_directx.c, common vo init functions handled by video_out.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Feb 18 23:16:34 CET 2007


Hello,
On Sun, Feb 18, 2007 at 01:02:08PM -0500, Erik Lunchpail wrote:
> --- Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> > On Sun, Feb 18, 2007 at 12:19:16PM -0500, Erik Lunchpail wrote:
> > > As per recent changes to video_out.c. Common functions handled
> > there.
> > 
> > I think it will change behaviour though.
> > Ans shouldn't esp.
> > GetWindowRect(hWnd,&rd);
> > stay under "if (!vo_geometry)" ?
> 
> Yes, sorry, updated.

Attached patch should work. w32_update_xinerama can not be used from
vo_directx, for various reasons.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libvo/video_out.c
===================================================================
--- libvo/video_out.c	(revision 22267)
+++ libvo/video_out.c	(working copy)
@@ -333,6 +333,7 @@
   vo->control(VOCTRL_UPDATE_SCREENINFO, NULL);
 
   if (vo_screenwidth && vo_screenheight) {
+  aspect_save_screenres(vo_screenwidth, vo_screenheight);
   aspect(&d_width,&d_height,A_NOZOOM);
   vo_dx = (int)(vo_screenwidth - d_width) / 2;
   vo_dy = (int)(vo_screenheight - d_height) / 2;
Index: libvo/vo_directx.c
===================================================================
--- libvo/vo_directx.c	(revision 22266)
+++ libvo/vo_directx.c	(working copy)
@@ -1271,8 +1271,6 @@
 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 @@
 	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 @@
     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,15 @@
 		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;
+        }
+        return VO_TRUE;
     case VOCTRL_RESET:
         last_rect.left = 0xDEADC0DE;   // reset window position cache
         // fall-through intended


More information about the MPlayer-dev-eng mailing list