basetransform: clear allocation parameters in passthrough
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 1 Mar 2012 10:11:43 +0000 (11:11 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 1 Mar 2012 16:41:57 +0000 (17:41 +0100)
Clear the allocation parameters when we operate in passthrough.

libs/gst/base/gstbasetransform.c

index 7d3a134..1f9dc28 100644 (file)
@@ -792,7 +792,7 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps)
 {
   GstQuery *query;
   gboolean result = TRUE;
-  GstBufferPool *pool = NULL, *oldpool;
+  GstBufferPool *pool = NULL;
   guint size, min, max, prefix, alignment;
   GstBaseTransformClass *klass;
   GstAllocator *allocator = NULL;
@@ -807,21 +807,13 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps)
    *    upstream allocator with our proposed values then.
    */
 
-  /* clear old pool */
-  oldpool = trans->priv->pool;
-  if (oldpool) {
-    GST_DEBUG_OBJECT (trans, "unreffing old pool");
-    gst_buffer_pool_set_active (oldpool, FALSE);
-    gst_object_unref (oldpool);
-    trans->priv->pool = oldpool = NULL;
-  }
-
   if (trans->passthrough || trans->always_in_place) {
     /* we are in passthrough, the input buffer is never copied and always passed
      * along. We never allocate an output buffer on the srcpad. What we do is
      * let the upstream element decide if it wants to use a bufferpool and
      * then we will proxy the downstream pool */
     GST_DEBUG_OBJECT (trans, "we're passthough, delay bufferpool");
+    gst_base_transform_set_allocation (trans, NULL, NULL, 0, 0);
     return TRUE;
   }