From 396c76a34ed60a08a36007da7df6c3fdc7232588 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Sat, 26 Nov 2011 17:34:12 +0100 Subject: [PATCH] baseparse: fix broken default caps query https://bugzilla.gnome.org/show_bug.cgi?id=664880 --- libs/gst/base/gstbaseparse.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 6fdfea0..09a5f69 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -1146,11 +1146,17 @@ gst_base_parse_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) res = TRUE; } else { - GstCaps *caps, *filter; + GstCaps *caps, *template_caps, *filter; gst_query_parse_caps (query, &filter); - caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); - gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST); + template_caps = gst_pad_get_pad_template_caps (pad); + 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_caps_unref (caps); -- 2.7.4