gst/gstvalue.c: Reorganize some more, be more conservative with the GST_TYPE_ARRAY...
authorWim Taymans <wim.taymans@gmail.com>
Thu, 6 Nov 2008 15:37:16 +0000 (15:37 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 6 Nov 2008 15:37:16 +0000 (15:37 +0000)
Original commit message from CVS:
* gst/gstvalue.c: (gst_type_is_fixed), (gst_value_is_fixed):
Reorganize some more, be more conservative with the GST_TYPE_ARRAY not
being fixed and inline the trivial check.

ChangeLog
gst/gstvalue.c

index 926aecd..7b3ac48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-11-06  Wim Taymans  <wim.taymans@collabora.co.uk>
 
+       * gst/gstvalue.c: (gst_type_is_fixed), (gst_value_is_fixed):
+       Reorganize some more, be more conservative with the GST_TYPE_ARRAY not
+       being fixed and inline the trivial check.
+
+2008-11-06  Wim Taymans  <wim.taymans@collabora.co.uk>
+
        * gst/gstcaps.c: (gst_caps_copy), (_gst_caps_free),
        (gst_caps_merge_structure), (gst_caps_get_structure),
        (gst_caps_copy_nth), (gst_caps_set_simple),
index 3a7b44c..66b2746 100644 (file)
@@ -157,8 +157,7 @@ gst_type_is_fixed (GType type)
   }
   /* our fundamental types that are certainly not fixed */
   if (type == GST_TYPE_INT_RANGE || type == GST_TYPE_DOUBLE_RANGE ||
-      type == GST_TYPE_LIST || type == GST_TYPE_FRACTION_RANGE ||
-      type == GST_TYPE_ARRAY) {
+      type == GST_TYPE_LIST || type == GST_TYPE_FRACTION_RANGE) {
     return FALSE;
   }
   /* other (boxed) types that are fixed */
@@ -3342,8 +3341,10 @@ gst_value_is_fixed (const GValue * value)
 {
   GType type = G_VALUE_TYPE (value);
 
-  if (gst_type_is_fixed (type))
+  /* the most common types are just basic plain glib types */
+  if (type <= G_TYPE_MAKE_FUNDAMENTAL (G_TYPE_RESERVED_GLIB_LAST)) {
     return TRUE;
+  }
 
   if (type == GST_TYPE_ARRAY) {
     gint size, n;
@@ -3358,8 +3359,7 @@ gst_value_is_fixed (const GValue * value)
     }
     return TRUE;
   }
-
-  return FALSE;
+  return gst_type_is_fixed (type);
 }
 
 /************