basetransform: copy metadata when using a pool

also copy the metadata when we allocated a new buffer from a pool
This commit is contained in:
Wim Taymans 2012-02-20 11:46:36 +01:00
parent 7b16febb0d
commit 810e67900b

View file

@ -1447,7 +1447,7 @@ default_prepare_output_buffer (GstBaseTransform * trans,
if (priv->pool) { if (priv->pool) {
GST_DEBUG_OBJECT (trans, "using pool alloc"); GST_DEBUG_OBJECT (trans, "using pool alloc");
ret = gst_buffer_pool_acquire_buffer (priv->pool, outbuf, NULL); 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 */ /* 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); GST_DEBUG_OBJECT (trans, "doing alloc of size %" G_GSIZE_FORMAT, outsize);
*outbuf = gst_buffer_new_allocate (priv->allocator, outsize, priv->alignment); *outbuf = gst_buffer_new_allocate (priv->allocator, outsize, priv->alignment);
copy_meta:
/* copy the metadata */ /* copy the metadata */
if (bclass->copy_metadata) if (bclass->copy_metadata)
if (!bclass->copy_metadata (trans, inbuf, *outbuf)) { if (!bclass->copy_metadata (trans, inbuf, *outbuf)) {