mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-10 10:04:23 +00:00
utils: If one intersection gave empty caps don't continue iterating over the other pads
This commit is contained in:
parent
25fc43487b
commit
d6492c2958
1 changed files with 8 additions and 2 deletions
|
@ -2630,6 +2630,8 @@ gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src)
|
|||
static gboolean
|
||||
intersect_caps_func (GstPad * pad, GValue * ret, GstPad * orig)
|
||||
{
|
||||
gboolean empty = FALSE;
|
||||
|
||||
/* skip the pad, the request came from */
|
||||
if (G_UNLIKELY (pad != orig)) {
|
||||
GstCaps *peercaps, *existing;
|
||||
|
@ -2637,13 +2639,17 @@ intersect_caps_func (GstPad * pad, GValue * ret, GstPad * orig)
|
|||
existing = g_value_get_pointer (ret);
|
||||
peercaps = gst_pad_peer_get_caps_reffed (pad);
|
||||
if (G_LIKELY (peercaps)) {
|
||||
g_value_set_pointer (ret, gst_caps_intersect (existing, peercaps));
|
||||
GstCaps *intersection = gst_caps_intersect (existing, peercaps);
|
||||
|
||||
empty = gst_caps_is_empty (intersection);
|
||||
|
||||
g_value_set_pointer (ret, intersection);
|
||||
gst_caps_unref (existing);
|
||||
gst_caps_unref (peercaps);
|
||||
}
|
||||
}
|
||||
gst_object_unref (pad);
|
||||
return TRUE;
|
||||
return !empty;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue