mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-17 21:06:17 +00:00
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.
This commit is contained in:
parent
6049559201
commit
c686053aac
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue