gst-plugins-bad: glpool: fix caps refcount issue

Nicolas Dufresne nicolas.dufresne at collabora.com
Fri Jan 15 18:47:57 PST 2016


Le jeudi 14 janvier 2016 à 19:05 -0800, Matthew Waters a écrit :
> Module: gst-plugins-bad
> Branch: master
> Commit: 3bdcdedfa00b87f1db505218789178318a16c743
> URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/
> ?id=3bdcdedfa00b87f1db505218789178318a16c743
> 
> Author: Matthew Waters <matthew at centricular.com>
> Date:   Fri Jan 15 14:00:56 2016 +1100
> 
> glpool: fix caps refcount issue
> 
> The caps are from an allocation query which are transfer none but
> were being
> treated as transfer full.
> 
> ---
> 
>  gst-libs/gst/gl/gstglbufferpool.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gst-libs/gst/gl/gstglbufferpool.c b/gst-
> libs/gst/gl/gstglbufferpool.c
> index c419ad5..598425c 100644
> --- a/gst-libs/gst/gl/gstglbufferpool.c
> +++ b/gst-libs/gst/gl/gstglbufferpool.c
> @@ -114,7 +114,7 @@ gst_gl_buffer_pool_set_config (GstBufferPool *
> pool, GstStructure * config)
>    if (!gst_buffer_pool_config_get_allocator (config, &allocator,
> &alloc_params))
>      goto wrong_config;
>  
> -  gst_caps_replace (&priv->caps, caps);
> +  gst_caps_replace (&priv->caps, gst_caps_ref (caps));

I believe this is wrong. gst_caps_replace() will ref caps before
setting it to priv->caps. At least this is what the doc says:

"the old caps is unreffed, the new is reffed."

So this code should effectively double ref that caps.

>  
>    if (priv->allocator)
>      gst_object_unref (priv->allocator);
> 
> _______________________________________________
> gstreamer-commits mailing list
> gstreamer-commits at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160115/1770d5ce/attachment.sig>


More information about the gstreamer-devel mailing list