Commit 0c5d5020 authored by Sebastian Dröge's avatar Sebastian Dröge

pad: Check for subsets, not non-empty intersections to check if caps are compatible

Pads should only accept caps that are a subset of the pad caps, e.g.
they should accept only caps that have a non-empty intersection and
at least all fields of the pad caps.

Without this a pad that wants for example
  "video/x-h264,stream-format=byte-stream"
will be happy to accept
  "video/x-h264".
parent 185ab7f3
......@@ -2554,7 +2554,7 @@ gst_pad_acceptcaps_default (GstPad * pad, GstCaps * caps)
GST_DEBUG_OBJECT (pad, "allowed caps %" GST_PTR_FORMAT, allowed);
result = gst_caps_can_intersect (allowed, caps);
result = gst_caps_is_subset (caps, allowed);
gst_caps_unref (allowed);
......@@ -2760,7 +2760,7 @@ gst_pad_configure_sink (GstPad * pad, GstCaps * caps)
gboolean res;
/* See if pad accepts the caps */
if (!gst_caps_can_intersect (caps, gst_pad_get_pad_template_caps (pad)))
if (!gst_caps_is_subset (caps, gst_pad_get_pad_template_caps (pad)))
goto not_accepted;
/* set caps on pad if call succeeds */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment