changeset 34887:b510e6c95427

unsharp: actually process the frame we got. Previously it would always process the last frame allocated, but that might be a different one than the one first returned.
author reimar
date Wed, 30 May 2012 20:34:02 +0000
parents 73842c97cac0
children 99ccfbcaa0fa
files libmpcodecs/vf_unsharp.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_unsharp.c	Wed May 30 19:33:09 2012 +0000
+++ b/libmpcodecs/vf_unsharp.c	Wed May 30 20:34:02 2012 +0000
@@ -165,6 +165,7 @@
     if( mpi->imgfmt!=vf->priv->outfmt )
         return; // colorspace differ
 
+    mpi->priv =
     vf->dmpi = vf_get_image( vf->next, mpi->imgfmt, mpi->type, mpi->flags, mpi->w, mpi->h );
     mpi->planes[0] = vf->dmpi->planes[0];
     mpi->stride[0] = vf->dmpi->stride[0];
@@ -179,12 +180,11 @@
 }
 
 static int put_image( struct vf_instance *vf, mp_image_t *mpi, double pts) {
-    mp_image_t *dmpi;
+    mp_image_t *dmpi = mpi->priv;
 
     if( !(mpi->flags & MP_IMGFLAG_DIRECT) )
         // no DR, so get a new image! hope we'll get DR buffer:
-        vf->dmpi = vf_get_image( vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h);
-    dmpi= vf->dmpi;
+        dmpi = vf->dmpi = vf_get_image( vf->next,vf->priv->outfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w, mpi->h);
 
     unsharp( dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w,   mpi->h,   &vf->priv->lumaParam );
     unsharp( dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam );