changeset 33311:00ab9ef28181

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.
author cboesch
date Sat, 07 May 2011 16:29:57 +0000
parents 464563f22be1
children fdfabd2d4476
files libmpcodecs/vf_smartblur.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);