mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
disparity: 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:
parent
72e46a4478
commit
a5eee1e28a
1 changed files with 2 additions and 2 deletions
|
@ -416,12 +416,12 @@ gst_disparity_handle_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
|||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_CAPS:
|
||||
g_mutex_lock (&fs->lock);
|
||||
if (!gst_pad_has_current_caps (fs->srcpad)) {
|
||||
current_caps = gst_pad_get_current_caps (fs->srcpad);
|
||||
if (current_caps == NULL) {
|
||||
template_caps = gst_pad_get_pad_template_caps (pad);
|
||||
gst_query_set_caps_result (query, template_caps);
|
||||
gst_caps_unref (template_caps);
|
||||
} else {
|
||||
current_caps = gst_pad_get_current_caps (fs->srcpad);
|
||||
gst_query_set_caps_result (query, current_caps);
|
||||
gst_caps_unref (current_caps);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue