diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-07-10 19:17:04 +0100 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-07-14 08:32:23 +0200 |
commit | c686053aac8ba5b856721aa7ca205e1c192c589d (patch) | |
tree | c3858f6eeba85f8b294c4b934bb7896788aa45c3 | |
parent | 60495592010aa7211dd33386e7aa5a4168181b40 (diff) |
value: fix can_intersect to behave like intersect
Add a quick return if two types are the same. Change the check for the
intersection function to be the same as the one used in intersect(). The
later tries both directions.
-rw-r--r-- | gst/gstvalue.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gst/gstvalue.c b/gst/gstvalue.c index 358fa82030..72504ab63a 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -3080,12 +3080,16 @@ gst_value_can_intersect (const GValue * value1, const GValue * value2) type1 = G_VALUE_TYPE (value1); type2 = G_VALUE_TYPE (value2); + if (type1 == type2) + return TRUE; + + /* check registered intersect functions */ len = gst_value_intersect_funcs->len; for (i = 0; i < len; i++) { intersect_info = &g_array_index (gst_value_intersect_funcs, GstValueIntersectInfo, i); - if (intersect_info->type1 == intersect_info->type2 && - intersect_info->type1 == type1 && intersect_info->type2 == type2) + if ((intersect_info->type1 == type1 && intersect_info->type2 == type2) || + (intersect_info->type1 == type2 && intersect_info->type2 == type1)) return TRUE; } |