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.
This commit is contained in:
Stefan Sauer 2013-02-21 08:15:45 +01:00
parent 95266cf212
commit a86ca535c8

View file

@ -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.