From ab6a1085ee10c94847722e0de36a46aa0da6f9af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 27 May 2013 16:38:18 +0200 Subject: [PATCH] (multi)queue: Don't access query items during flushing --- plugins/elements/gstmultiqueue.c | 8 ++++++-- plugins/elements/gstqueue.c | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 9a87e2c..9e9209c 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 aae51aa..765005d 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)); -- 2.7.4