From: Thiago Santos Date: Tue, 19 Apr 2011 23:35:04 +0000 (-0300) Subject: basetransform: fix negotiation regression X-Git-Tag: RELEASE-0.10.33~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0253c85b0d683b86b788c1a1c85aafff8d13a862;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 71cc9b9..ccf0802 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");