baseparse: fix broken default caps query

https://bugzilla.gnome.org/show_bug.cgi?id=664880
This commit is contained in:
Matej Knopp 2011-11-26 17:34:12 +01:00 committed by Tim-Philipp Müller
parent d3264c4b9d
commit 396c76a34e

View file

@ -1146,11 +1146,17 @@ gst_base_parse_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
res = TRUE; res = TRUE;
} else { } else {
GstCaps *caps, *filter; GstCaps *caps, *template_caps, *filter;
gst_query_parse_caps (query, &filter); gst_query_parse_caps (query, &filter);
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); template_caps = gst_pad_get_pad_template_caps (pad);
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); if (filter != NULL) {
caps =
gst_caps_intersect_full (filter, template_caps,
GST_CAPS_INTERSECT_FIRST);
} else {
caps = gst_caps_copy (template_caps);
}
gst_query_set_caps_result (query, caps); gst_query_set_caps_result (query, caps);
gst_caps_unref (caps); gst_caps_unref (caps);