summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-03-05 15:23:46 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2012-03-05 15:23:46 +0100
commit247d2d08f77e6d0dbde3521a55b6a0c1db7ef61a (patch)
tree8b75c2e083fbb9085377fe13453a1b84ff83101e /libs
parent7eae198be21ebd57aa99f3aa1fb4dd6f005746ab (diff)
basetransform: don't propose_allocation before negotiation
Answer the allocation query with FALSE when we are not negotiated yet because at that point we have no idea if we need to proxy the allocation query or not.
Diffstat (limited to 'libs')
-rw-r--r--libs/gst/base/gstbasetransform.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c
index d0d02592d..a7e47c492 100644
--- a/libs/gst/base/gstbasetransform.c
+++ b/libs/gst/base/gstbasetransform.c
@@ -1362,13 +1362,20 @@ gst_base_transform_default_query (GstBaseTransform * trans,
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_ALLOCATION:
{
- GstQuery *decide_query;
+ GstQuery *decide_query = NULL;
+ gboolean negotiated;
/* can only be done on the sinkpad */
if (direction != GST_PAD_SINK)
goto done;
GST_OBJECT_LOCK (trans);
+ if (G_UNLIKELY (!(negotiated = trans->negotiated))) {
+ GST_DEBUG_OBJECT (trans,
+ "not negotiated yet, can't answer ALLOCATION query");
+ GST_OBJECT_UNLOCK (trans);
+ goto done;
+ }
if ((decide_query = trans->priv->query))
gst_query_ref (decide_query);
GST_OBJECT_UNLOCK (trans);