dataurisrc: Don't assume that get_current_caps() returns non-NULL caps after has_current_caps()

Remove calls to gst_pad_has_current_caps() which then go on to call
gst_pad_get_current_caps() as the caps can go to NULL in between. Instead just
use gst_pad_get_current_caps() and check for NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=759539
This commit is contained in:
Sebastian Dröge 2016-02-23 18:17:42 +02:00
parent a5eee1e28a
commit fd42320ec1

View file

@ -177,9 +177,8 @@ gst_data_uri_src_get_caps (GstBaseSrc * basesrc, GstCaps * filter)
GstCaps *caps;
GST_OBJECT_LOCK (src);
if (gst_pad_has_current_caps (GST_BASE_SRC_PAD (basesrc)))
caps = gst_pad_get_current_caps (GST_BASE_SRC_PAD (basesrc));
else
caps = gst_pad_get_current_caps (GST_BASE_SRC_PAD (basesrc));
if (!caps)
caps = gst_caps_new_any ();
GST_OBJECT_UNLOCK (src);