Index: vf_cropdetect.c =================================================================== --- vf_cropdetect.c (revision 23574) +++ vf_cropdetect.c (working copy) @@ -16,6 +16,7 @@ int limit; int round; int fno; + float aspect; }; static int checkline(unsigned char* src,int stride,int len,int bpp){ @@ -50,11 +51,17 @@ vf->priv->x2=0; vf->priv->y2=0; vf->priv->fno=0; + if (d_height == 0) + vf->priv->aspect = 1; + else + vf->priv->aspect = (float)d_width/(float)d_height; return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ mp_image_t *dmpi; + float ratio; + float stretch; int bpp=mpi->bpp/8; int w,h,x,y,shrink_by; @@ -124,13 +131,24 @@ shrink_by = h % vf->priv->round; h -= shrink_by; y += (shrink_by / 2 + 1) & ~1; + ratio = (((float)(vf->priv->x2 - vf->priv->x1 + 1))/ + ((float)(vf->priv->y2 - vf->priv->y1 + 1))); + if ((mpi->height == 0) || (mpi->width == 0)) + stretch = 1; + else + stretch = vf->priv->aspect / ((float)mpi->width/ (float)mpi->height); - mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_CropArea, - vf->priv->x1,vf->priv->x2, - vf->priv->y1,vf->priv->y2, - w,h,x,y); + mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_CropArea, + vf->priv->x1,vf->priv->x2, + vf->priv->y1,vf->priv->y2, ratio * stretch, + w,h,x,y); +// mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_CropArea, +// vf->priv->x1,vf->priv->x2, +// vf->priv->y1,vf->priv->y2, +// w,h,x,y); + } return vf_next_put_image(vf,dmpi, pts);