From 0253c85b0d683b86b788c1a1c85aafff8d13a862 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 19 Apr 2011 20:35:04 -0300 Subject: [PATCH] basetransform: fix negotiation regression Fixup patch for 83597767b169dd6c39a07b6144a650c1f098825a 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 --- libs/gst/base/gstbasetransform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 71cc9b9e2d..ccf0802c24 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -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");