mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
basesrc: handle reference in set_allocation rather than in prepare_allocation
Otherwise we can forget to unref objects in error cases. https://bugzilla.gnome.org/show_bug.cgi?id=736680
This commit is contained in:
parent
84c6e885f1
commit
fefd6d06a1
1 changed files with 10 additions and 0 deletions
|
@ -2965,6 +2965,11 @@ gst_base_src_set_allocation (GstBaseSrc * basesrc, GstBufferPool * pool,
|
|||
oldalloc = priv->allocator;
|
||||
priv->allocator = allocator;
|
||||
|
||||
if (priv->pool)
|
||||
gst_object_ref (priv->pool);
|
||||
if (priv->allocator)
|
||||
gst_object_ref (priv->allocator);
|
||||
|
||||
if (params)
|
||||
priv->params = *params;
|
||||
else
|
||||
|
@ -3141,6 +3146,11 @@ gst_base_src_prepare_allocation (GstBaseSrc * basesrc, GstCaps * caps)
|
|||
|
||||
result = gst_base_src_set_allocation (basesrc, pool, allocator, ¶ms);
|
||||
|
||||
if (allocator)
|
||||
gst_object_unref (allocator);
|
||||
if (pool)
|
||||
gst_object_unref (pool);
|
||||
|
||||
gst_query_unref (query);
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue