basetransform: check acquire result value

Check the result value from _buffer_pool_acquire() and return the
value when allocation failed.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=684285
This commit is contained in:
Wim Taymans 2012-09-18 21:49:41 +02:00
parent 8f51345296
commit 0ea3675cf4

View file

@ -1516,7 +1516,7 @@ default_prepare_output_buffer (GstBaseTransform * trans,
GstBuffer * inbuf, GstBuffer ** outbuf)
{
GstBaseTransformPrivate *priv;
GstFlowReturn ret = GST_FLOW_OK;
GstFlowReturn ret;
GstBaseTransformClass *bclass;
GstCaps *incaps, *outcaps;
gsize insize, outsize;
@ -1544,6 +1544,9 @@ default_prepare_output_buffer (GstBaseTransform * trans,
}
GST_DEBUG_OBJECT (trans, "using pool alloc");
ret = gst_buffer_pool_acquire_buffer (priv->pool, outbuf, NULL);
if (ret != GST_FLOW_OK)
goto alloc_failed;
goto copy_meta;
}
@ -1590,7 +1593,7 @@ copy_meta:
}
done:
return ret;
return GST_FLOW_OK;
/* ERRORS */
/* ERRORS */
@ -1605,6 +1608,11 @@ unknown_size:
GST_ERROR_OBJECT (trans, "unknown output size");
return GST_FLOW_ERROR;
}
alloc_failed:
{
GST_DEBUG_OBJECT (trans, "could not allocate buffer from pool");
return ret;
}
}
typedef struct