From cf85710b39572cfae8459429d9e49635faede723 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 29 Aug 2006 14:39:42 +0000 Subject: [PATCH] gst/gstcaps.c: Code cleanups. Original commit message from CVS: * gst/gstcaps.c: (gst_caps_structure_is_subset_field): Code cleanups. Fix memleak. --- ChangeLog | 6 ++++++ gst/gstcaps.c | 27 ++++++--------------------- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index a403ae40c7..f7befc6497 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-08-29 Wim Taymans + + * gst/gstcaps.c: (gst_caps_structure_is_subset_field): + Code cleanups. + Fix memleak. + 2006-08-29 Tim-Philipp Müller * gst/gstxml.c: diff --git a/gst/gstcaps.c b/gst/gstcaps.c index fe3d3d121d..b0ec1f9000 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -494,43 +494,28 @@ gst_caps_structure_is_subset_field (GQuark field_id, const GValue * value, /* field is missing in one set */ return FALSE; } - /*{ - gchar *str = g_strdup_value_contents (value); - GST_DEBUG (" value: '%s'", str); - g_free (str); - str = g_strdup_value_contents (other); - GST_DEBUG (" other: '%s'", str); - g_free (str); - } */ /* - [1,2] - 1 = 2 - 1 - [1,2] = � ??? + * [1,2] - 1 = 2 + * 1 - [1,2] = ??? */ if (!gst_value_subtract (&subtraction, other, value)) { /* empty result -> values are the same, or first was a value and * second was a list - */ - /* verify that result is empty by swapping args */ + * verify that result is empty by swapping args */ if (!gst_value_subtract (&subtraction, value, other)) { - /*GST_DEBUG (" values are the same"); */ return TRUE; } g_value_unset (&subtraction); return FALSE; } - /*{ - gchar *str = g_strdup_value_contents (&subtraction); - GST_DEBUG (" diff: '%s'", str); - g_free (str); - } */ + res = gst_value_compare (&subtraction, other); + g_value_unset (&subtraction); + if (res == GST_VALUE_EQUAL) { /* value was empty ? */ - g_value_unset (&subtraction); - /*GST_DEBUG (" compare = equal (%d)",res); */ return FALSE; } else { - /*GST_DEBUG (" compare = unequal/unordered (%d)",res); */ return TRUE; } }