value: avoid duplicates when intersecting lists
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 29 Sep 2012 13:35:58 +0000 (14:35 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 29 Sep 2012 13:35:58 +0000 (14:35 +0100)
commit507fc9cea7d587446fba08dfeac7e063e14c680e
treecff502cb924257c783f6be1f776fc456f5e9a459
parent51492812cf864708129d263523ca9cd46d702984
value: avoid duplicates when intersecting lists

Fixes negotiation taking a ridiculous amount of
time (multiple 10s of seconds on a core2) when
there are duplicate entries in lists.

Could have a negative performance impact on other
scenarios because we now have to iterate the
dest list to avoid duplicates, but we don't
have a lot of lists any more these days, and
they tend to be small anyway. The negatives
are hopefully countered by the positive effects
of reducing the list length early on in the
process. And in any case, it's the right thing
to do.

Based on patch by Andre Moreira Magalhaes.

https://bugzilla.gnome.org/show_bug.cgi?id=684981
gst/gstvalue.c
tests/check/gst/gstcaps.c