From 57573d8705d717e6dc8c3bf25eae95f59b62dd51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 8 Dec 2011 17:21:30 +0100 Subject: [PATCH] basetransform: Fall back to upstream provided caps if suggested caps are not supported by the sinkpad --- libs/gst/base/gstbasetransform.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 9acb942..d762f7b 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -1962,7 +1962,20 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size, templ = gst_pad_get_pad_template_caps (pad); - if (!gst_caps_can_intersect (sink_suggest, templ)) { + /* Fall back to the upstream caps if the suggested caps + * are not actually supported. Shouldn't really happen + */ + if (suggest && !gst_caps_can_intersect (sink_suggest, templ)) { + GST_DEBUG_OBJECT (trans, + "Suggested caps not supported by sinkpad, using upstream caps"); + gst_caps_replace (&sink_suggest, caps); + size_suggest = size; + suggest = FALSE; + new_caps = sink_suggest + && !gst_caps_is_equal (sink_suggest, priv->sink_alloc); + } + + if (new_caps && (suggest || !gst_caps_can_intersect (sink_suggest, templ))) { GstCaps *allowed; GstCaps *peercaps; -- 2.7.4