X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstvalue.c;h=8835dce08d1e7fd7e19d304deedabd00f63d3c52;hb=f34472822c257359d69ebf671b81d85646a40618;hp=5dcfd5ef459545f873091ad0eb38b1a4951d2bc4;hpb=c3613658909df193e42a71cf6b5f3fcb6d51d2e0;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstvalue.c b/gst/gstvalue.c index 5dcfd5e..8835dce 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -276,7 +276,10 @@ _gst_value_serialize_g_value_array (const GValue * value, const gchar * begin, GString *s; GValue *v; gchar *s_val; - guint alen = array->n_values; + guint alen = 0; + + if (array) + alen = array->n_values; /* estimate minimum string length to minimise re-allocs in GString */ s = g_string_sized_new (2 + (6 * alen) + 2); @@ -1936,7 +1939,7 @@ gst_value_set_fraction_range_full (GValue * value, * * Gets the minimum of the range specified by @value. * - * Returns: the minimum of the range + * Returns: (nullable): the minimum of the range */ const GValue * gst_value_get_fraction_range_min (const GValue * value) @@ -1959,7 +1962,7 @@ gst_value_get_fraction_range_min (const GValue * value) * * Gets the maximum of the range specified by @value. * - * Returns: the maximum of the range + * Returns: (nullable): the maximum of the range */ const GValue * gst_value_get_fraction_range_max (const GValue * value) @@ -2754,6 +2757,12 @@ gst_value_compare_structure (const GValue * value1, const GValue * value2) GstStructure *structure1 = GST_STRUCTURE (g_value_get_boxed (value1)); GstStructure *structure2 = GST_STRUCTURE (g_value_get_boxed (value2)); + if (structure1 == structure2) + return GST_VALUE_EQUAL; + + if (!structure1 || !structure2) + return GST_VALUE_UNORDERED; + if (gst_structure_is_equal (structure1, structure2)) return GST_VALUE_EQUAL; @@ -5486,7 +5495,7 @@ gst_value_list_equals_range (const GValue * list, const GValue * value) } /* "Pure" variant of gst_value_compare which is guaranteed to - * not have list arguments and therefore does basic comparisions + * not have list arguments and therefore does basic comparisons */ static inline gint _gst_value_compare_nolist (const GValue * value1, const GValue * value2) @@ -7487,10 +7496,10 @@ G_STMT_START { \ /* These initial sizes are used for the tables * below, and save a couple of reallocs at startup */ -static const gint GST_VALUE_TABLE_DEFAULT_SIZE = 35; -static const gint GST_VALUE_UNION_TABLE_DEFAULT_SIZE = 4; -static const gint GST_VALUE_INTERSECT_TABLE_DEFAULT_SIZE = 11; -static const gint GST_VALUE_SUBTRACT_TABLE_DEFAULT_SIZE = 12; +static const gint GST_VALUE_TABLE_DEFAULT_SIZE = 40; +static const gint GST_VALUE_UNION_TABLE_DEFAULT_SIZE = 8; +static const gint GST_VALUE_INTERSECT_TABLE_DEFAULT_SIZE = 16; +static const gint GST_VALUE_SUBTRACT_TABLE_DEFAULT_SIZE = 16; void _priv_gst_value_initialize (void) @@ -7677,22 +7686,22 @@ _priv_gst_value_initialize (void) #if GST_VERSION_NANO == 1 /* If building from git master, check starting array sizes matched actual size * so we can keep the defines in sync and save a few reallocs on startup */ - if (gst_value_table->len != GST_VALUE_TABLE_DEFAULT_SIZE) { + if (gst_value_table->len > GST_VALUE_TABLE_DEFAULT_SIZE) { GST_ERROR ("Wrong initial gst_value_table size. " "Please set GST_VALUE_TABLE_DEFAULT_SIZE to %u in gstvalue.c", gst_value_table->len); } - if (gst_value_union_funcs->len != GST_VALUE_UNION_TABLE_DEFAULT_SIZE) { + if (gst_value_union_funcs->len > GST_VALUE_UNION_TABLE_DEFAULT_SIZE) { GST_ERROR ("Wrong initial gst_value_union_funcs table size. " "Please set GST_VALUE_UNION_TABLE_DEFAULT_SIZE to %u in gstvalue.c", gst_value_union_funcs->len); } - if (gst_value_intersect_funcs->len != GST_VALUE_INTERSECT_TABLE_DEFAULT_SIZE) { + if (gst_value_intersect_funcs->len > GST_VALUE_INTERSECT_TABLE_DEFAULT_SIZE) { GST_ERROR ("Wrong initial gst_value_intersect_funcs table size. " "Please set GST_VALUE_INTERSECT_TABLE_DEFAULT_SIZE to %u in gstvalue.c", gst_value_intersect_funcs->len); } - if (gst_value_subtract_funcs->len != GST_VALUE_SUBTRACT_TABLE_DEFAULT_SIZE) { + if (gst_value_subtract_funcs->len > GST_VALUE_SUBTRACT_TABLE_DEFAULT_SIZE) { GST_ERROR ("Wrong initial gst_value_subtract_funcs table size. " "Please set GST_VALUE_SUBTRACT_TABLE_DEFAULT_SIZE to %u in gstvalue.c", gst_value_subtract_funcs->len);