basetransform: copy metadata when using a pool
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 20 Feb 2012 10:46:36 +0000 (11:46 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 20 Feb 2012 10:46:36 +0000 (11:46 +0100)
also copy the metadata when we allocated a new buffer from a pool

libs/gst/base/gstbasetransform.c

index 2da03ac..8bc6247 100644 (file)
@@ -1447,7 +1447,7 @@ default_prepare_output_buffer (GstBaseTransform * trans,
   if (priv->pool) {
     GST_DEBUG_OBJECT (trans, "using pool alloc");
     ret = gst_buffer_pool_acquire_buffer (priv->pool, outbuf, NULL);
-    goto done;
+    goto copy_meta;
   }
 
   /* no pool, we need to figure out the size of the output buffer first */
@@ -1483,6 +1483,7 @@ default_prepare_output_buffer (GstBaseTransform * trans,
   GST_DEBUG_OBJECT (trans, "doing alloc of size %" G_GSIZE_FORMAT, outsize);
   *outbuf = gst_buffer_new_allocate (priv->allocator, outsize, priv->alignment);
 
+copy_meta:
   /* copy the metadata */
   if (bclass->copy_metadata)
     if (!bclass->copy_metadata (trans, inbuf, *outbuf)) {