(multi)queue: Don't access query items during flushing

This commit is contained in:
Sebastian Dröge 2013-05-27 16:38:18 +02:00
parent e472d9d261
commit ab6a1085ee
2 changed files with 8 additions and 3 deletions

View file

@ -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));
}

View file

@ -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));