From ce69180862f151776d94776bf1a8f67468eeaad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 19 Nov 2014 17:15:02 +0100 Subject: [PATCH] aggregator: Drop serialized events/queries if the pad is flushing https://bugzilla.gnome.org/show_bug.cgi?id=740376 --- gst-libs/gst/base/gstaggregator.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gst-libs/gst/base/gstaggregator.c b/gst-libs/gst/base/gstaggregator.c index 6e2f8b0439..0fce62496d 100644 --- a/gst-libs/gst/base/gstaggregator.c +++ b/gst-libs/gst/base/gstaggregator.c @@ -1627,10 +1627,17 @@ pad_query_func (GstPad * pad, GstObject * parent, GstQuery * query) PAD_WAIT_EVENT (aggpad); } PAD_UNLOCK_EVENT (aggpad); + + if (g_atomic_int_get (&aggpad->priv->flushing) == TRUE) + goto flushing; } return klass->sink_query (GST_AGGREGATOR (parent), GST_AGGREGATOR_PAD (pad), query); + +flushing: + GST_DEBUG_OBJECT (aggpad, "Pad is flushing, dropping query"); + return FALSE; } static gboolean @@ -1647,10 +1654,21 @@ pad_event_func (GstPad * pad, GstObject * parent, GstEvent * event) PAD_WAIT_EVENT (aggpad); } PAD_UNLOCK_EVENT (aggpad); + + if (g_atomic_int_get (&aggpad->priv->flushing) == TRUE + && GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_STOP) + goto flushing; } return klass->sink_event (GST_AGGREGATOR (parent), GST_AGGREGATOR_PAD (pad), event); + +flushing: + GST_DEBUG_OBJECT (aggpad, "Pad is flushing, dropping event"); + if (GST_EVENT_IS_STICKY (event)) + gst_pad_store_sticky_event (pad, event); + gst_event_unref (event); + return FALSE; } static gboolean