changeset 34883:3efd3d87424b

Move decrementing usage count to a common place. This should work for most filters without having to check and change each one.
author reimar
date Fri, 25 May 2012 20:31:11 +0000
parents 649d4cad4619
children 57bb464310a7
files libmpcodecs/vf.c libmpcodecs/vf_ass.c libmpcodecs/vf_expand.c
diffstat 3 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf.c	Fri May 25 20:31:10 2012 +0000
+++ b/libmpcodecs/vf.c	Fri May 25 20:31:11 2012 +0000
@@ -692,6 +692,7 @@
 }
 
 int vf_next_put_image(struct vf_instance *vf,mp_image_t *mpi, double pts){
+    mpi->usage_count--;
     return vf->next->put_image(vf->next,mpi, pts);
 }
 
--- a/libmpcodecs/vf_ass.c	Fri May 25 20:31:10 2012 +0000
+++ b/libmpcodecs/vf_ass.c	Fri May 25 20:31:11 2012 +0000
@@ -169,8 +169,6 @@
             mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_MPCODECS_FunWhydowegetNULL);
             return 0;
         }
-        // allow reusing it after this processing
-        vf->dmpi->usage_count--;
         mpi->priv = NULL;
         // we've used DR, so we're ready...
         if (ass_top_margin)
--- a/libmpcodecs/vf_expand.c	Fri May 25 20:31:10 2012 +0000
+++ b/libmpcodecs/vf_expand.c	Fri May 25 20:31:11 2012 +0000
@@ -415,7 +415,6 @@
     if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){
 	vf->dmpi=mpi->priv;
 	if(!vf->dmpi) { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_FunWhydowegetNULL); return 0; }
-	vf->dmpi->usage_count--;
 	mpi->priv=NULL;
 #ifdef OSD_SUPPORT
 	if(vf->priv->osd) draw_osd(vf,mpi->w,mpi->h);