[MPlayer-cygwin] [PATCH] directx overlay centering when using -wip

Gianluigi Tiesi mplayer at netfarm.it
Wed Feb 9 17:52:49 CET 2005


Ok my patch was interfering with -geometry, this is an updated patch
that disables autocentering if passing -geometry.
This makes mplayer to autocenter ALWAYS the overlay even if window if
moved or resized, using -geometry locks overlay size and position.

Bye


-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
-------------- next part --------------
diff -NubBr -xCVS -xhelp_mp.h -x'*.a' -x'*.exe' -x'*.o' -xconfigure.log -xconfig.mak -x.cvsignore -xconfig.h -xcodecs.conf.h -xversion.h -x.depend main/libvo/vo_directx.c sherpya/libvo/vo_directx.c
--- main/libvo/vo_directx.c	2005-01-08 11:06:38.212283200 +0100
+++ sherpya/libvo/vo_directx.c	2005-02-09 17:47:07.579273600 +0100
@@ -516,6 +516,7 @@
     DDOVERLAYFX     ovfx;
     DWORD           dwUpdateFlags=0;
     int width,height;
+    int cw, ch;
    
     if(vo_fs || vidmode){
       aspect(&width,&height,A_ZOOM);
@@ -540,8 +541,8 @@
       pt.y = 0;
       ClientToScreen(hWnd,&pt);  
       GetClientRect(hWnd, &rd);
-	  width=rd.right - rd.left;
-	  height=rd.bottom - rd.top;
+	  width=cw=rd.right - rd.left;
+	  height=ch=rd.bottom - rd.top;
       pt.x -= monitor_rect.left;    /* move coordinates from global to local monitor space */
       pt.y -= monitor_rect.top;
       rd.right -= monitor_rect.left;
@@ -567,6 +568,20 @@
     rd.right=rd.left+width;
     rd.bottom=rd.top+height;
 
+    /* Centering overlay image - disabled if passing geometry */
+    if(!vidmode && !vo_fs && !vo_geometry)
+    {
+        cw=(cw-width)/2;
+        cw+=cw%2;
+        ch=(ch-height)/2;
+        ch+=ch%2;
+    
+        rd.left+=cw;
+        rd.right+=cw;
+        rd.top+=ch;
+        rd.bottom+=ch;
+    }
+
 	/*ok, let's workaround some overlay limitations*/
 	if(!nooverlay)
 	{


More information about the MPlayer-cygwin mailing list