[vlc-devel] commit: Do not increase refcount when the release callback is not present. (Laurent Aimar )
git version control
git at videolan.org
Thu Jul 17 22:43:27 CEST 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Jul 17 22:45:03 2008 +0200| [76ab4696aa1dd14a349a7492faf4f93ddb13cbfc]
Do not increase refcount when the release callback is not present.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=76ab4696aa1dd14a349a7492faf4f93ddb13cbfc
---
src/misc/image.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/misc/image.c b/src/misc/image.c
index 4fc679a..3117ce4 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -316,7 +316,8 @@ static block_t *ImageWrite( image_handler_t *p_image, picture_t *p_pic,
p_image->p_filter->fmt_out.video = p_image->p_enc->fmt_in.video;
}
- p_pic->i_refcount++; /* pf_video_filter() will call pf_release() */
+ if( p_pic->pf_release )
+ p_pic->i_refcount++;
p_tmp_pic =
p_image->p_filter->pf_video_filter( p_image->p_filter, p_pic );
@@ -445,7 +446,8 @@ static picture_t *ImageConvert( image_handler_t *p_image, picture_t *p_pic,
p_image->p_filter->fmt_out.video = *p_fmt_out;
}
- p_pic->i_refcount++; /* pf_video_filter() will call pf_release() */
+ if( p_pic->pf_release )
+ p_pic->i_refcount++;
p_pif = p_image->p_filter->pf_video_filter( p_image->p_filter, p_pic );
if( p_fmt_in->i_chroma == p_fmt_out->i_chroma &&
@@ -491,7 +493,8 @@ static picture_t *ImageFilter( image_handler_t *p_image, picture_t *p_pic,
p_image->p_filter->fmt_out.video = *p_fmt;
}
- p_pic->i_refcount++; /* pf_video_filter() will call pf_release() */
+ if( p_pic->pf_release )
+ p_pic->i_refcount++;
return p_image->p_filter->pf_video_filter( p_image->p_filter, p_pic );
}
More information about the vlc-devel
mailing list