From a86ca535c88a604daa431b0bc1cf4cd8fbb2d100 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Thu, 21 Feb 2013 08:15:45 +0100 Subject: [PATCH] adder: ensure sending a flush-stop after flush-start Previously adder was only sending the flush-stop, when it saw the flushing seek. If one sends a flushing see direcly to an element upstream of adder, it would fail to unflush the downstream pads. --- gst/adder/gstadder.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index bddb7867e2..e390bf9a33 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -817,6 +817,16 @@ gst_adder_sink_event (GstCollectPads * pads, GstCollectData * pad, gst_event_unref (event); event = NULL; } + case GST_EVENT_FLUSH_START: + /* ensure that we'll eventually send a flush-stop, when we have received a + * flush-start (e.g. after a flushing seek directly sent to an element) */ + if (g_atomic_int_compare_and_exchange (&adder->flush_stop_pending, + FALSE, TRUE)) { + /* discard flush start events, as we forwarded one already when handing the + * flushing seek on the sink pad */ + discard = TRUE; + } + break; case GST_EVENT_FLUSH_STOP: /* we received a flush-stop. We will only forward it when * flush_stop_pending is set, and we will unset it then.