From: Sebastian Dröge Date: Mon, 9 Apr 2012 14:40:47 +0000 (+0200) Subject: multiqueue: Don't use buffer after pushing it downstream X-Git-Tag: RELEASE-0.11.90~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=829eafad0eef9c311c29c07f7d6b211969dda4fb;p=platform%2Fupstream%2Fgstreamer.git multiqueue: Don't use buffer after pushing it downstream --- diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 9891b93..11344e5 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1193,6 +1193,7 @@ gst_multi_queue_loop (GstPad * pad) guint32 newid; GstFlowReturn result; GstClockTime next_time; + gboolean is_buffer; sq = (GstSingleQueue *) gst_pad_get_element_private (pad); mq = sq->mqueue; @@ -1214,6 +1215,8 @@ gst_multi_queue_loop (GstPad * pad) object = gst_multi_queue_item_steal_object (item); gst_multi_queue_item_destroy (item); + is_buffer = GST_IS_BUFFER (object); + /* Get running time of the item. Events will have GST_CLOCK_TIME_NONE */ next_time = get_running_time (&sq->src_segment, object, TRUE); @@ -1323,6 +1326,7 @@ gst_multi_queue_loop (GstPad * pad) /* Try to push out the new object */ result = gst_single_queue_push_one (mq, sq, object); + object = NULL; /* Check if we pushed something already and if this is * now a switch from an active to a non-active stream. @@ -1358,14 +1362,12 @@ gst_multi_queue_loop (GstPad * pad) } } - if (GST_IS_BUFFER (object)) + if (is_buffer) sq->pushed = TRUE; sq->srcresult = result; sq->last_oldid = newid; GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); - object = NULL; - if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED && result != GST_FLOW_UNEXPECTED) goto out_flushing;