diff --git a/ChangeLog b/ChangeLog index f4b1d39512..435e5a967f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-09 Wim Taymans + + * gst/gstbin.c: (remove_from_queue): + Work around a problem with pipelines containing (semi)loops until a + proper, more complicated solution is ready. See #475455. + 2007-10-09 Tim-Philipp Müller * gst/gstplugin.c: diff --git a/gst/gstbin.c b/gst/gstbin.c index 9c6403c6a5..560da12b5f 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -1588,10 +1588,18 @@ add_to_queue (GstBinSortIterator * bit, GstElement * element) static void remove_from_queue (GstBinSortIterator * bit, GstElement * element) { - GST_DEBUG_OBJECT (bit->bin, "removing '%s' from queue", - GST_ELEMENT_NAME (element)); - g_queue_remove (bit->queue, element); - gst_object_unref (element); + GList *find; + + if ((find = g_queue_find (bit->queue, element))) { + GST_DEBUG_OBJECT (bit->bin, "removing '%s' from queue", + GST_ELEMENT_NAME (element)); + + g_queue_delete_link (bit->queue, find); + gst_object_unref (element); + } else { + GST_DEBUG_OBJECT (bit->bin, "unable to remove '%s' from queue", + GST_ELEMENT_NAME (element)); + } } /* clear the queue, unref all objects as we took a ref when