[MPlayer-dev-eng] [PATCH]Move calc_drwXY

Diego Biurrun diego at biurrun.de
Fri Jan 9 01:40:48 CET 2009


On Fri, Jan 09, 2009 at 02:48:10AM +0100, Carl Eugen Hoyos wrote:
>
> Attached patch is hopefully what Reimar suggested to avoid code  
> duplication in vo_vdpau.
>
> Please comment, Carl Eugen

> --- libvo/x11_common.c	(revision 28281)
> +++ libvo/x11_common.c	(working copy)
> @@ -1854,6 +1855,22 @@
>  
> +void vo_calc_drwXY(uint32_t *drwX, uint32_t *drwY) {
> +  *drwX = *drwY = 0;
> +  if (vo_fs) {
> +    aspect(&vo_dwidth, &vo_dheight, A_ZOOM);
> +    vo_dwidth = FFMIN(vo_dwidth, vo_screenwidth);
> +    vo_dheight = FFMIN(vo_dheight, vo_screenheight);
> +    *drwX = (vo_screenwidth - vo_dwidth) / 2;
> +    *drwY = (vo_screenheight - vo_dheight) / 2;
> +    mp_msg(MSGT_VO, MSGL_V, "[vo-fs] dx: %d dy: %d dw: %d dh: %d\n",
> +           *drwX, *drwY, vo_dwidth, vo_dheight);
> +  } else if (WinID == 0) {
> +    *drwX = vo_dx;
> +    *drwY = vo_dy;
> +  }
> +}

Please use 4 space indentation and K&R function declarations like the
rest of the file does.

Diego



More information about the MPlayer-dev-eng mailing list