summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward.hervey@collabora.co.uk>2011-10-06 10:50:12 +0200
committerRené Stadler <rene.stadler@collabora.co.uk>2011-10-30 21:47:02 +0100
commit46c355038b9998ab57801511797ad17e8b013dfa (patch)
tree89e9772df3fbc358ae8d0b57956dd4888e68f608
parent4aae58a37c4bde61130a042b5b9d26fd0b969930 (diff)
gnlsource: Don't use _accept_caps to figure out compatible pads
It isn't reliable due to issues with gst_caps_is_subset. Instead we just check if a pad caps intersect with the target caps Ported from 0.11 (471611). Fixes bug #662312. Conflicts: gnl/gnlsource.c
-rw-r--r--gnl/gnlsource.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gnl/gnlsource.c b/gnl/gnlsource.c
index cec125a..fcce139 100644
--- a/gnl/gnlsource.c
+++ b/gnl/gnlsource.c
@@ -202,6 +202,8 @@ static void
element_pad_added_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
GnlSource * source)
{
+ GstCaps *srccaps;
+
GST_DEBUG_OBJECT (source, "pad %s:%s", GST_DEBUG_PAD_NAME (pad));
if (source->priv->ghostpad || source->priv->pendingblock) {
@@ -212,10 +214,13 @@ element_pad_added_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
return;
}
- if (!(gst_pad_accept_caps (pad, GNL_OBJECT (source)->caps))) {
+ srccaps = gst_pad_get_caps_reffed (pad);
+ if (!gst_caps_can_intersect (srccaps, GNL_OBJECT (source)->caps)) {
+ gst_caps_unref (srccaps);
GST_DEBUG_OBJECT (source, "Pad doesn't have valid caps, ignoring");
return;
}
+ gst_caps_unref (srccaps);
GST_DEBUG_OBJECT (pad, "valid pad, about to add event probe and pad block");
@@ -267,13 +272,19 @@ static gint
compare_src_pad (GstPad * pad, GstCaps * caps)
{
gint ret;
+ GstCaps *padcaps;
+
+ padcaps = gst_pad_get_caps_reffed (pad);
- if (gst_pad_accept_caps (pad, caps))
+ if (gst_caps_can_intersect (padcaps, caps))
ret = 0;
else {
gst_object_unref (pad);
ret = 1;
}
+
+ gst_caps_unref (padcaps);
+
return ret;
}