queuearray: fix gst_queue_array_find()

https://bugzilla.gnome.org/show_bug.cgi?id=692691
This commit is contained in:
Alexander Schrab 2013-01-28 11:05:28 +01:00 committed by Tim-Philipp Müller
parent af8ff1bed8
commit 5a7c1b56dc

View file

@ -303,9 +303,9 @@ gst_queue_array_find (GstQueueArray * array, GCompareFunc func, gpointer data)
guint i;
/* Scan from head to tail */
for (i = array->head; i < array->length; i = (i + 1) % array->size)
if (func (array->array[i], data) == 0)
return i;
for (i = 0; i < array->length; i++)
if (func (array->array[(i + array->head) % array->size], data) == 0)
return (i + array->head) % array->size;
return -1;
}