From 69409f1ec8f18d9e483682e820986d82f8f2566e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 20 Jun 2011 17:32:47 +0200 Subject: [PATCH] basetransform: activate the bufferpool always activate the bufferpool, even if we get it from the allocation query. --- libs/gst/base/gstbasetransform.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 4384c65c2a..5f33dbe673 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -710,7 +710,7 @@ done: return caps; } -static void +static gboolean gst_base_transform_set_allocation (GstBaseTransform * trans, GstBufferPool * pool, const GstMemoryAllocator * allocator, guint prefix, guint alignment) @@ -718,6 +718,12 @@ gst_base_transform_set_allocation (GstBaseTransform * trans, GstBufferPool *oldpool; GstBaseTransformPrivate *priv = trans->priv; + /* activate */ + if (pool) { + if (!gst_buffer_pool_set_active (pool, TRUE)) + goto activate_failed; + } + GST_OBJECT_LOCK (trans); oldpool = priv->pool; priv->pool = pool; @@ -730,6 +736,14 @@ gst_base_transform_set_allocation (GstBaseTransform * trans, gst_buffer_pool_set_active (oldpool, FALSE); gst_object_unref (oldpool); } + return FALSE; + + /* ERRORS */ +activate_failed: + { + GST_ERROR_OBJECT (trans, "failed to activate bufferpool."); + return FALSE; + } } static gboolean @@ -801,24 +815,14 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps) gst_buffer_pool_config_set (config, outcaps, size, min, max, prefix, alignment); gst_buffer_pool_set_config (pool, config); - - /* activate */ - if (!gst_buffer_pool_set_active (pool, TRUE)) - goto activate_failed; } /* and store */ - gst_base_transform_set_allocation (trans, pool, allocator, prefix, alignment); + result = + gst_base_transform_set_allocation (trans, pool, allocator, prefix, + alignment); return result; - - /* ERRORS */ -activate_failed: - { - GST_ERROR_OBJECT (trans, "failed to activate bufferpool."); - gst_object_unref (pool); - return FALSE; - } } /* function triggered when the in and out caps are negotiated and need