plugins/elements/gstqueue.c: Recheck queue filledness after signalling the overrun...
authorSjoerd Simons <sjoerd@luon.net>
Wed, 11 Oct 2006 10:10:37 +0000 (10:10 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 11 Oct 2006 10:10:37 +0000 (10:10 +0000)
Original commit message from CVS:
Patch by: Sjoerd Simons <sjoerd at luon dot net>
* plugins/elements/gstqueue.c: (gst_queue_chain):
Recheck queue filledness after signalling the overrun when we're about
to leak downstream because we released the lock when emitting the signal
and the queue could be empty again. Fixes #352345.

ChangeLog
plugins/elements/gstqueue.c

index af20c3e..e743a93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-10-11  Wim Taymans  <wim@fluendo.com>
+
+       Patch by: Sjoerd Simons <sjoerd at luon dot net>
+
+       * plugins/elements/gstqueue.c: (gst_queue_chain):
+       Recheck queue filledness after signalling the overrun when we're about
+       to leak downstream because we released the lock when emitting the signal
+       and the queue could be empty again. Fixes #352345.
+
 2006-10-11  Tim-Philipp Müller  <tim at centricular dot net>
 
        * libs/gst/controller/gstcontroller.c: (gst_controller_new_list):
index 0b61ffa..1f3f1f1 100644 (file)
@@ -654,6 +654,13 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
         GList *item;
         GstMiniObject *leak = NULL;
 
+        if (!gst_queue_is_filled (queue)) {
+          /* Queue was emptied while we sent out the signal, so no need to drop */
+          GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
+              "queue emptied while emitting signal, not leaking buffer");
+          break;
+        }
+
         GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
             "queue is full, leaking buffer on downstream end");