basesrc: handle NULL from getcaps

If the getcaps functions returns NULL, return FALSE from the CAPS query.
This commit is contained in:
Wim Taymans 2012-01-19 15:17:58 +01:00
parent acf0d50bf1
commit c6ac51e729

View file

@ -1178,10 +1178,13 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery * query)
bclass = GST_BASE_SRC_GET_CLASS (src);
if (bclass->get_caps) {
gst_query_parse_caps (query, &filter);
caps = bclass->get_caps (src, filter);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
if ((caps = bclass->get_caps (src, filter))) {
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
res = TRUE;
} else {
res = FALSE;
}
} else
res = FALSE;
break;