mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
pad: check query caps answered and caps not NULL
https://bugzilla.gnome.org/show_bug.cgi?id=768450
This commit is contained in:
parent
52b1d7f42d
commit
9f982e2d75
1 changed files with 14 additions and 5 deletions
19
gst/gstpad.c
19
gst/gstpad.c
|
@ -2759,16 +2759,25 @@ gst_pad_get_allowed_caps (GstPad * pad)
|
|||
|
||||
/* Query peer caps */
|
||||
query = gst_query_new_caps (mycaps);
|
||||
gst_pad_peer_query (pad, query);
|
||||
gst_query_parse_caps_result (query, &caps);
|
||||
gst_caps_ref (caps);
|
||||
gst_query_unref (query);
|
||||
if (!gst_pad_peer_query (pad, query)) {
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "Caps query failed");
|
||||
goto end;
|
||||
}
|
||||
|
||||
gst_caps_unref (mycaps);
|
||||
gst_query_parse_caps_result (query, &caps);
|
||||
if (caps == NULL) {
|
||||
g_warn_if_fail (caps != NULL);
|
||||
goto end;
|
||||
}
|
||||
gst_caps_ref (caps);
|
||||
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "allowed caps %" GST_PTR_FORMAT,
|
||||
caps);
|
||||
|
||||
end:
|
||||
gst_query_unref (query);
|
||||
gst_caps_unref (mycaps);
|
||||
|
||||
return caps;
|
||||
|
||||
no_peer:
|
||||
|
|
Loading…
Reference in a new issue