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

Joey Parrish joey at nicewarrior.org
Wed Feb 9 16:51:00 CET 2005


On Wed, Feb 09, 2005 at 04:51:50AM +0100, Gianluigi Tiesi wrote:
> Overlay is not centered when using -wip.

Do you mean to say -wid?
And have you tested the effect of this patch with -wid and both with
and without -geometry?

I also don't understand the purpose of this patch.

> This patches solves it, please test it if there are some side effects.

--Joey

> --- main/libvo/vo_directx.c	2005-01-08 11:06:38.212283200 +0100
> +++ sherpya/libvo/vo_directx.c	2005-02-09 04:19:09.880352000 +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 +569,20 @@
>      rd.right=rd.left+width;
>      rd.bottom=rd.top+height;
>  
> +    /* Centering overlay image */
> +    if(!vidmode && !vo_fs)
> +    {
> +        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)
>  	{

-- 
"There's no blood in your brain?  You're one of the lucky ones." --Chad




More information about the MPlayer-cygwin mailing list