# HG changeset patch # User cboesch # Date 1304785797 0 # Node ID 00ab9ef28181be05bcb521714c7bdbb8bc36069d # Parent 464563f22be197aaac71e5b1e9dc9e901e309404 vf_smartblur: fix threshold condition. The threshold condition was broken (spotted because of a bad cast warning) and should now be fixed and using both luma and chroma threshold. The patch also fixes setting MP_IMGFLAG_READABLE (priorities fixed with the brackets) in the vf_get_image call. diff -r 464563f22be1 -r 00ab9ef28181 libmpcodecs/vf_smartblur.c --- a/libmpcodecs/vf_smartblur.c Sat May 07 16:16:23 2011 +0000 +++ b/libmpcodecs/vf_smartblur.c Sat May 07 16:29:57 2011 +0000 @@ -183,11 +183,11 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ int cw= mpi->w >> mpi->chroma_x_shift; int ch= mpi->h >> mpi->chroma_y_shift; - FilterParam *f= &vf->priv; + int threshold = vf->priv->luma.threshold || vf->priv->chroma.threshold; mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE| - (f->threshold) ? MP_IMGFLAG_READABLE : 0, + (threshold ? MP_IMGFLAG_READABLE : 0), mpi->w,mpi->h); assert(mpi->flags&MP_IMGFLAG_PLANAR);