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
This commit is contained in:
Thiago Santos 2014-12-09 16:05:27 -03:00
parent f24075887f
commit f492085552

View file

@ -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);