controller: Fix gst_interpolation_control_source_find_control_point_iter
authorBenjamin Otte <otte@redhat.com>
Mon, 26 Apr 2010 13:43:17 +0000 (15:43 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 26 Apr 2010 14:46:11 +0000 (16:46 +0200)
commit6fb4cda8fb84c203d562adfe3eb9ed37218c42f8
treea5ecfeb71ad8ff6d9af0a6d956423f40a256414d
parent18c775cbf84b089e24311cb0202ec959927ffd2e
controller: Fix gst_interpolation_control_source_find_control_point_iter

The logic in that function is broken. Various NULL-checking bandaids for
guaranteed non-NULL variables didn't even help there.

This patch updates the function to check if a previous item exists
before fetching it instead of after. This makes all other tests
unnecessary.
In particular, it makes the check for an empty list unnecessary, because
for empty lists the only iter is the begin iter (and the end iter) and
so the new check catches that case.

https://bugzilla.gnome.org/show_bug.cgi?id=616846
libs/gst/controller/gstinterpolation.c