diff options
author | Edward Hervey <bilboed@bilboed.com> | 2010-07-20 20:49:12 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2010-07-20 20:52:35 +0200 |
commit | 21c8edca2a04938a9afcd63d7ac3b82a8cb87c9b (patch) | |
tree | dbb2efcb57df1e82ab2ec0866da800037999d019 | |
parent | 29a35e70e11d78923654f76ed0fb2efca14c6244 (diff) |
gstpad: Assume pads are compatible if we don't have templates
This is the same behaviour as if we had a pad template caps of
GST_CAPS_ANY on any of the pads (i.e. the actual check will be done
during caps negotiation).
-rw-r--r-- | gst/gstpad.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c index 14aebc9e8b..ae742c142c 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1796,12 +1796,16 @@ gst_pad_link_check_compatible_unlocked (GstPad * src, GstPad * sink, srccaps = gst_pad_get_caps_unlocked (src); sinkcaps = gst_pad_get_caps_unlocked (sink); } else { - if (GST_PAD_PAD_TEMPLATE (src)) - srccaps = - gst_caps_ref (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (src))); - if (GST_PAD_PAD_TEMPLATE (sink)) - sinkcaps = - gst_caps_ref (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (sink))); + /* If one of the two pads doesn't have a template, consider the intersection + * as valid.*/ + if (G_UNLIKELY ((GST_PAD_PAD_TEMPLATE (src) == NULL) + || (GST_PAD_PAD_TEMPLATE (sink) == NULL))) { + compatible = TRUE; + goto done; + } + srccaps = gst_caps_ref (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (src))); + sinkcaps = + gst_caps_ref (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (sink))); } GST_CAT_DEBUG (GST_CAT_CAPS, "src caps %" GST_PTR_FORMAT, srccaps); |