[Mplayer-cvslog] CVS: main/libmpcodecs vf_crop.c,1.13,1.14
Arpi
arpi at thot.banki.hu
Sun Apr 27 23:12:28 CEST 2003
Hi,
> +static void draw_slice(struct vf_instance_s* vf,
> + unsigned char** src, int* stride, int w,int h, int x, int y){
> + //mp_msg(MSGT_VFILTER, MSGL_V, "crop slice %d %d %d %d ->", w,h,x,y);
> + if ((x -= vf->priv->crop_x) < 0) {
> + w += x;
> + x = 0;
> + }
> + if ((y -= vf->priv->crop_y) < 0) {
> + h += y;
> + y = 0;
> + }
> + if (x+w > vf->priv->crop_w) w = vf->priv->crop_w-x;
> + if (y+h > vf->priv->crop_h) h = vf->priv->crop_h-y;
> + //mp_msg(MSGT_VFILTER, MSGL_V, "%d %d %d %d\n", w,h,x,y);
> + if ((w < 0) || (h < 0)) return;
> + vf_next_draw_slice(vf,src,stride,w,h,x,y);
> +}
imho this is broken. you should adjust src[] too (but copy it instead of
in-place modification, it's not allowed!), changing x,y is not enough (it's
used only as destination coordinates, src[] points is the upper left pixel
of the area to be copied)
A'rpi / Astral & ESP-team
--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
More information about the MPlayer-cvslog
mailing list