Revert "caps: Optimize gst_caps_is_subset()"

This reverts commit 32248a9b85.

This breaks some tests in -base and the failures should
be fixed first.
This commit is contained in:
Sebastian Dröge 2011-05-27 12:56:03 +02:00
parent 32248a9b85
commit d706ca0859

View file

@ -1133,9 +1133,8 @@ gst_caps_is_always_compatible (const GstCaps * caps1, const GstCaps * caps2)
gboolean gboolean
gst_caps_is_subset (const GstCaps * subset, const GstCaps * superset) gst_caps_is_subset (const GstCaps * subset, const GstCaps * superset)
{ {
GstStructure *s1, *s2; GstCaps *caps;
gboolean ret = TRUE; gboolean ret;
gint i, j;
g_return_val_if_fail (subset != NULL, FALSE); g_return_val_if_fail (subset != NULL, FALSE);
g_return_val_if_fail (superset != NULL, FALSE); g_return_val_if_fail (superset != NULL, FALSE);
@ -1145,24 +1144,9 @@ gst_caps_is_subset (const GstCaps * subset, const GstCaps * superset)
if (CAPS_IS_ANY (subset) || CAPS_IS_EMPTY (superset)) if (CAPS_IS_ANY (subset) || CAPS_IS_EMPTY (superset))
return FALSE; return FALSE;
for (i = subset->structs->len - 1; i >= 0; i--) { caps = gst_caps_subtract (subset, superset);
for (j = superset->structs->len - 1; j >= 0; j--) { ret = CAPS_IS_EMPTY_SIMPLE (caps);
s1 = gst_caps_get_structure_unchecked (subset, i); gst_caps_unref (caps);
s2 = gst_caps_get_structure_unchecked (superset, j);
if (gst_caps_structure_is_subset (s2, s1)) {
/* If we found a superset, continue with the next
* subset structure */
break;
}
}
/* If we found no superset for this subset structure
* we return FALSE immediately */
if (j == -1) {
ret = FALSE;
break;
}
}
return ret; return ret;
} }