From f49208555226d3f65816ed143440a1777551620f Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 9 Dec 2014 16:05:27 -0300 Subject: [PATCH] videoutils: return empty if the element has no possible allowed caps Instead of returning the template caps and having a failure happen later because there are no possible caps https://bugzilla.gnome.org/show_bug.cgi?id=741263 --- gst-libs/gst/video/gstvideoutilsprivate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/gstvideoutilsprivate.c b/gst-libs/gst/video/gstvideoutilsprivate.c index 04b7405358..917422316e 100644 --- a/gst-libs/gst/video/gstvideoutilsprivate.c +++ b/gst-libs/gst/video/gstvideoutilsprivate.c @@ -56,9 +56,12 @@ __gst_video_element_proxy_getcaps (GstElement * element, GstPad * sinkpad, gst_pad_get_pad_template_caps (sinkpad); allowed = gst_pad_get_allowed_caps (srcpad); - if (!allowed || gst_caps_is_empty (allowed) || gst_caps_is_any (allowed)) { + if (!allowed || gst_caps_is_any (allowed)) { fcaps = templ_caps; goto done; + } else if (gst_caps_is_empty (allowed)) { + fcaps = gst_caps_ref (allowed); + goto done; } GST_LOG_OBJECT (element, "template caps %" GST_PTR_FORMAT, templ_caps);