Revert "Revert "basetransform: Use check for subsets and not non-empty intersection...
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 8 Sep 2011 12:39:30 +0000 (14:39 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 8 Sep 2011 12:39:30 +0000 (14:39 +0200)
This reverts commit 0bc6d49c950210bf422615fb8dc98c5adcd5e456.

Conflicts:

libs/gst/base/gstbasetransform.c

libs/gst/base/gstbasetransform.c

index a335482..49f032a 100644 (file)
@@ -919,7 +919,6 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
   GstBaseTransformClass *klass;
   GstPad *otherpad, *otherpeer;
   GstCaps *othercaps;
-  gboolean peer_checked = FALSE;
   gboolean is_fixed;
 
   /* caps must be fixed here, this is a programming error if it's not */
@@ -1000,7 +999,6 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
       gst_caps_unref (othercaps);
       othercaps = intersection;
       is_fixed = gst_caps_is_fixed (othercaps);
-      peer_checked = TRUE;
     } else {
       GST_DEBUG_OBJECT (trans, "no peer, doing passthrough");
       gst_caps_unref (othercaps);
@@ -1024,7 +1022,6 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
     /* FIXME: when fixating using the vmethod, it might make sense to fixate
      * each of the caps; but Wim doesn't see a use case for that yet */
     gst_caps_truncate (othercaps);
-    peer_checked = FALSE;
 
     if (klass->fixate_caps) {
       GST_DEBUG_OBJECT (trans, "trying to fixate %" GST_PTR_FORMAT
@@ -1064,9 +1061,8 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
   if (!is_fixed)
     goto could_not_fixate;
 
-  /* and peer should accept, don't check again if we already checked the
-   * othercaps against the peer. */
-  if (!peer_checked && otherpeer && !gst_pad_accept_caps (otherpeer, othercaps))
+  /* and peer should accept */
+  if (!gst_pad_accept_caps (otherpeer, othercaps))
     goto peer_no_accept;
 
   GST_DEBUG_OBJECT (trans, "Input caps were %" GST_PTR_FORMAT
@@ -1148,7 +1144,7 @@ gst_base_transform_acceptcaps_default (GstBaseTransform * trans,
     GST_DEBUG_OBJECT (trans, "allowed caps %" GST_PTR_FORMAT, allowed);
 
     /* intersect with the requested format */
-    ret = gst_caps_can_intersect (allowed, caps);
+    ret = gst_caps_is_subset (caps, allowed);
     gst_caps_unref (allowed);
 
     if (!ret)