basetransform: handle gst_base_transform_query_caps() returning NULL

If gst_base_transform_transform_caps() returns NULL, gst_base_transform_query_caps()
will return NULL as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2532>
This commit is contained in:
Guillaume Desmottes 2022-06-01 09:25:29 +02:00
parent 15c69c17ea
commit 0086d7b016

View file

@ -1595,6 +1595,10 @@ gst_base_transform_default_query (GstBaseTransform * trans,
gst_query_parse_caps (query, &filter);
caps = gst_base_transform_query_caps (trans, pad, filter);
if (!caps) {
GST_WARNING_OBJECT (pad, "no caps can be handled by this pad");
caps = gst_caps_new_empty ();
}
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
ret = TRUE;