summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2003-11-25 22:08:45 +0000
committerBenjamin Otte <otte@gnome.org>2003-11-25 22:08:45 +0000
commit387b7f7f5bbc9e7df13e466ee8ab18aba103f46a (patch)
treef45035ed4adcc7a0db5a362fa1da19f6b49d92d0
parent0ee999abcf04fad8a659856b681c33e5a31f8f2b (diff)
make sure props are really sorted before intersecting them.CAPS-MERGE-1
Original commit message from CVS: make sure props are really sorted before intersecting them. And then intersect them correctly
-rw-r--r--gst/gstprops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gst/gstprops.c b/gst/gstprops.c
index 49f922c9d9..ee6549ebc4 100644
--- a/gst/gstprops.c
+++ b/gst/gstprops.c
@@ -2391,7 +2391,16 @@ G_STMT_START { \
GST_PROPS_FLAG_UNSET ((props), GST_PROPS_FIXED); \
props->properties = g_list_prepend ((props)->properties, toadd); \
} G_STMT_END
+static gint
+compare_props_entry (gconstpointer one, gconstpointer two)
+{
+ GstPropsEntry *a = (GstPropsEntry *) one;
+ GstPropsEntry *b = (GstPropsEntry *) two;
+ if (a->propid > b->propid) return 1;
+ if (a->propid < b->propid) return -1;
+ return 0;
+}
/**
* gst_props_intersect:
* @props1: a property
@@ -2417,6 +2426,9 @@ gst_props_intersect (GstProps *props1, GstProps *props2)
intersection = gst_props_empty_new ();
+ props1->properties = g_list_sort (props1->properties, compare_props_entry);
+ props2->properties = g_list_sort (props2->properties, compare_props_entry);
+
props1list = props1->properties;
props2list = props2->properties;
@@ -2445,6 +2457,8 @@ gst_props_intersect (GstProps *props1, GstProps *props2)
entry2 = (GstPropsEntry *)props2list->data;
}
+ if (entry1->propid < entry2->propid)
+ continue;
/* at this point we are talking about the same property */
iprops = gst_props_entry_intersect (entry1, entry2);
if (!iprops) {