From: Sebastian Dröge Date: Sun, 13 Jun 2010 09:24:10 +0000 (+0200) Subject: iterator: If the iterator resync in find_custom() just retry X-Git-Tag: RELEASE-0.10.30~123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4ccbe093e105213a68837514aea20dc9017c0c2;p=platform%2Fupstream%2Fgstreamer.git iterator: If the iterator resync in find_custom() just retry --- diff --git a/gst/gstiterator.c b/gst/gstiterator.c index 8cb9f01..43d9b3f 100644 --- a/gst/gstiterator.c +++ b/gst/gstiterator.c @@ -634,8 +634,7 @@ find_custom_fold_func (gpointer item, GValue * ret, FindCustomFoldData * data) * * The iterator will not be freed. * - * This function will return NULL if an error or resync happened to - * the iterator. + * This function will return NULL if an error happened to the iterator. * * Returns: The element in the iterator that matches the compare * function or NULL when no element matched. @@ -654,11 +653,11 @@ gst_iterator_find_custom (GstIterator * it, GCompareFunc func, data.func = func; data.user_data = user_data; - /* FIXME, we totally ignore RESYNC and return NULL so that the - * app does not know if the element was not found or a resync happened */ - res = - gst_iterator_fold (it, (GstIteratorFoldFunction) find_custom_fold_func, - &ret, &data); + do { + res = + gst_iterator_fold (it, (GstIteratorFoldFunction) find_custom_fold_func, + &ret, &data); + } while (res == GST_ITERATOR_RESYNC); /* no need to unset, it's just a pointer */ return g_value_get_pointer (&ret);