From 8c67b6390ee9e33810f5c6f2098ab4645f1c3651 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 28 Sep 2009 13:19:10 +0200 Subject: [PATCH] plugins/multiqueue: Use cached value instead of expensive object get. The task will always exist as long as its owner (i.e. the pad) and that owner's owner (i.e. multiqueue) exist. Reduces the number of instruction fetches by 36%. --- plugins/elements/gstmultiqueue.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index eb310f8a11..7eb8a2255d 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -966,7 +966,7 @@ gst_multi_queue_chain (GstPad * pad, GstBuffer * buffer) GstClockTime timestamp, duration; sq = gst_pad_get_element_private (pad); - mq = (GstMultiQueue *) gst_pad_get_parent (pad); + mq = sq->mqueue; /* Get a unique incrementing id */ GST_MULTI_QUEUE_MUTEX_LOCK (mq); @@ -989,8 +989,6 @@ gst_multi_queue_chain (GstPad * pad, GstBuffer * buffer) apply_buffer (mq, sq, timestamp, duration, &sq->sink_segment); done: - gst_object_unref (mq); - return ret; /* ERRORS */