summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2013-05-27 16:38:18 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-05-27 16:38:18 +0200
commitab6a1085ee10c94847722e0de36a46aa0da6f9af (patch)
tree0d9ef98937fa5d02e7535eeb090c80e91dafcc1c /plugins
parente472d9d261de6023d0eecfbe61f8353e20c76c28 (diff)
(multi)queue: Don't access query items during flushing
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstmultiqueue.c8
-rw-r--r--plugins/elements/gstqueue.c3
2 files changed, 8 insertions, 3 deletions
diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c
index 9a87e2c1b..9e9209c08 100644
--- a/plugins/elements/gstmultiqueue.c
+++ b/plugins/elements/gstmultiqueue.c
@@ -1967,6 +1967,7 @@ static void
gst_single_queue_flush_queue (GstSingleQueue * sq, gboolean full)
{
GstDataQueueItem *sitem;
+ GstMultiQueueItem *mitem;
gboolean was_flushing = FALSE;
while (!gst_data_queue_is_empty (sq->queue)) {
@@ -1982,10 +1983,13 @@ gst_single_queue_flush_queue (GstSingleQueue * sq, gboolean full)
continue;
}
+ mitem = (GstMultiQueueItem *) sitem;
+
data = sitem->object;
- if (!full && GST_IS_EVENT (data) && GST_EVENT_IS_STICKY (data) &&
- GST_EVENT_TYPE (data) != GST_EVENT_SEGMENT
+ if (!full && !mitem->is_query && GST_IS_EVENT (data)
+ && GST_EVENT_IS_STICKY (data)
+ && GST_EVENT_TYPE (data) != GST_EVENT_SEGMENT
&& GST_EVENT_TYPE (data) != GST_EVENT_EOS) {
gst_pad_store_sticky_event (sq->srcpad, GST_EVENT_CAST (data));
}
diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c
index aae51aa2f..765005dbe 100644
--- a/plugins/elements/gstqueue.c
+++ b/plugins/elements/gstqueue.c
@@ -589,7 +589,8 @@ gst_queue_locked_flush (GstQueue * queue, gboolean full)
/* Then lose another reference because we are supposed to destroy that
data when flushing */
- if (!full && GST_IS_EVENT (qitem->item) && GST_EVENT_IS_STICKY (qitem->item)
+ if (!full && !qitem->is_query && GST_IS_EVENT (qitem->item)
+ && GST_EVENT_IS_STICKY (qitem->item)
&& GST_EVENT_TYPE (qitem->item) != GST_EVENT_SEGMENT
&& GST_EVENT_TYPE (qitem->item) != GST_EVENT_EOS) {
gst_pad_store_sticky_event (queue->srcpad, GST_EVENT_CAST (qitem->item));