summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorEdward Hervey <edward@collabora.com>2012-02-17 15:09:06 -0800
committerEdward Hervey <edward@collabora.com>2012-02-17 15:11:38 -0800
commit7f8be6935aab0e3952710bdbb3638efcb547486a (patch)
treef207a176213e8c40062a003ff008fb4f5397e868 /libs
parent60be53fabfefb75719620e5eb88ee739faff058e (diff)
basetransform: Handle return value of decide_allocation vmethod
If it fails, properly propagate the error
Diffstat (limited to 'libs')
-rw-r--r--libs/gst/base/gstbasetransform.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c
index f8bea18fb..2da03ac6b 100644
--- a/libs/gst/base/gstbasetransform.c
+++ b/libs/gst/base/gstbasetransform.c
@@ -840,7 +840,8 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps)
GST_DEBUG_OBJECT (trans, "calling decide_allocation");
if (G_LIKELY (klass->decide_allocation))
- result = klass->decide_allocation (trans, query);
+ if ((result = klass->decide_allocation (trans, query)) == FALSE)
+ goto no_decide_allocation;
/* we got configuration from our peer, parse them */
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
@@ -874,6 +875,15 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps)
alignment);
return result;
+
+ /* Errors */
+no_decide_allocation:
+ {
+ GST_WARNING_OBJECT (trans, "Subclass failed to decide allocation");
+ gst_query_unref (query);
+
+ return result;
+ }
}
/* function triggered when the in and out caps are negotiated and need