gstpad: Fix flush-stop event handling

A flush-stop event would make a pad unflushing, causing it
to start acting as an activated pad. This, for example,
could lead to the chain function being called when stuff
isn't initialized.

This could happend when setting qtdemux to NULL while a seek
was being handled in the upstream filesrc (in push mode).

This patch makes it check if it is activated before setting
it to unflushing.
This commit is contained in:
Thiago Santos 2010-09-13 20:39:50 -03:00
parent 8ef7e46d24
commit 60fba4df8b

View file

@ -5074,8 +5074,10 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "set flush flag");
break;
case GST_EVENT_FLUSH_STOP:
GST_PAD_UNSET_FLUSHING (pad);
GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "cleared flush flag");
if (G_LIKELY (GST_PAD_ACTIVATE_MODE (pad) != GST_ACTIVATE_NONE)) {
GST_PAD_UNSET_FLUSHING (pad);
GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "cleared flush flag");
}
GST_OBJECT_UNLOCK (pad);
/* grab stream lock */
GST_PAD_STREAM_LOCK (pad);