summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2014-06-19 08:05:40 +0100
committerTim-Philipp Müller <tim@centricular.com>2014-06-19 08:40:15 +0100
commitbbefd6082fe5e9072f0363dc825144366f2ca6c1 (patch)
tree61eff4e729d57ba78de1381d8dd551174509c982
parentadcbe94aff8e61e1ecd35820611036bfa5d8d86b (diff)
gstvalue: add internal _can_compare_unchecked()
-rw-r--r--gst/gstvalue.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gst/gstvalue.c b/gst/gstvalue.c
index 7a8f6476d..880e8b823 100644
--- a/gst/gstvalue.c
+++ b/gst/gstvalue.c
@@ -4421,6 +4421,15 @@ gst_value_get_compare_func (const GValue * value1)
return NULL;
}
+static inline gboolean
+gst_value_can_compare_unchecked (const GValue * value1, const GValue * value2)
+{
+ if (G_VALUE_TYPE (value1) != G_VALUE_TYPE (value2))
+ return FALSE;
+
+ return gst_value_get_compare_func (value1) != NULL;
+}
+
/**
* gst_value_can_compare:
* @value1: a value to compare
@@ -4436,10 +4445,7 @@ gst_value_can_compare (const GValue * value1, const GValue * value2)
g_return_val_if_fail (G_IS_VALUE (value1), FALSE);
g_return_val_if_fail (G_IS_VALUE (value2), FALSE);
- if (G_VALUE_TYPE (value1) != G_VALUE_TYPE (value2))
- return FALSE;
-
- return gst_value_get_compare_func (value1) != NULL;
+ return gst_value_can_compare_unchecked (value1, value2);
}
static gboolean
@@ -4776,7 +4782,7 @@ gst_value_can_intersect (const GValue * value1, const GValue * value2)
return TRUE;
}
- return gst_value_can_compare (value1, value2);
+ return gst_value_can_compare_unchecked (value1, value2);
}
/**
@@ -4967,7 +4973,7 @@ gst_value_can_subtract (const GValue * minuend, const GValue * subtrahend)
return TRUE;
}
- return gst_value_can_compare (minuend, subtrahend);
+ return gst_value_can_compare_unchecked (minuend, subtrahend);
}
/* gst_value_register_subtract_func: (skip)