basetransform: fix negotiation regression

Fixup patch for 83597767b1

Use a separate variable for knowing if a pad alloc has been made
instead of checking for the flow return that might not be the
result of the pad alloc

https://bugzilla.gnome.org/show_bug.cgi?id=648220
This commit is contained in:
Thiago Santos 2011-04-19 20:35:04 -03:00 committed by Tim-Philipp Müller
parent e029aeef9e
commit 0253c85b0d

View file

@ -1715,6 +1715,7 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
GstBaseTransformClass *klass;
GstBaseTransformPrivate *priv;
GstFlowReturn res;
gboolean alloced = FALSE;
gboolean proxy, suggest, same_caps;
GstCaps *sink_suggest = NULL;
guint size_suggest;
@ -1921,6 +1922,7 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
res = gst_pad_alloc_buffer (trans->srcpad, offset, size, caps, buf);
if (res != GST_FLOW_OK)
goto alloc_failed;
alloced = TRUE;
/* check if the caps changed */
newcaps = GST_BUFFER_CAPS (*buf);
@ -1966,7 +1968,7 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
if (sink_suggest)
gst_caps_unref (sink_suggest);
if (res == GST_FLOW_OK) {
if (res == GST_FLOW_OK && alloced) {
/* just alloc'ed a buffer, so we only want to do this again if we
* received a buffer */
GST_DEBUG_OBJECT (trans, "Cleaning force alloc");