summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2011-11-16 12:10:55 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2011-11-16 12:11:12 +0100
commit06d4828df3f6867b83e44e946c71145624892452 (patch)
treec7191b02bdb776e51fb16f7b7737449085c1ffbe /plugins
parentfe3af1d67bb0c71eb624da7fa6f353b54e02d279 (diff)
plugins: remove obsolete parent checks
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstfunnel.c28
-rw-r--r--plugins/elements/gstinputselector.c36
-rw-r--r--plugins/elements/gstmultiqueue.c6
-rw-r--r--plugins/elements/gstoutputselector.c18
-rw-r--r--plugins/elements/gstqueue.c40
-rw-r--r--plugins/elements/gstqueue2.c37
-rw-r--r--plugins/elements/gsttee.c19
-rw-r--r--plugins/elements/gstvalve.c11
8 files changed, 33 insertions, 162 deletions
diff --git a/plugins/elements/gstfunnel.c b/plugins/elements/gstfunnel.c
index a10810c24..12ede11a5 100644
--- a/plugins/elements/gstfunnel.c
+++ b/plugins/elements/gstfunnel.c
@@ -215,7 +215,7 @@ static GstFlowReturn
gst_funnel_sink_chain (GstPad * pad, GstBuffer * buffer)
{
GstFlowReturn res;
- GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnel *funnel = GST_FUNNEL (GST_PAD_PARENT (pad));
GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad);
GstEvent *event = NULL;
GstClockTime newts;
@@ -275,7 +275,6 @@ gst_funnel_sink_chain (GstPad * pad, GstBuffer * buffer)
#if 0
out:
#endif
- gst_object_unref (funnel);
return res;
}
@@ -283,16 +282,11 @@ out:
static gboolean
gst_funnel_sink_event (GstPad * pad, GstEvent * event)
{
- GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnel *funnel = GST_FUNNEL (GST_PAD_PARENT (pad));
GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad);
gboolean forward = TRUE;
gboolean res = TRUE;
- if (G_UNLIKELY (funnel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
-
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT:
{
@@ -320,28 +314,19 @@ gst_funnel_sink_event (GstPad * pad, GstEvent * event)
else
gst_event_unref (event);
- gst_object_unref (funnel);
-
return res;
}
static gboolean
gst_funnel_sink_query (GstPad * pad, GstQuery * query)
{
- GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnel *funnel = GST_FUNNEL (GST_PAD_PARENT (pad));
gboolean forward = TRUE;
gboolean res = TRUE;
- if (G_UNLIKELY (funnel == NULL)) {
- gst_query_unref (query);
- return FALSE;
- }
-
if (forward)
res = gst_pad_peer_query (funnel->srcpad, query);
- gst_object_unref (funnel);
-
return res;
}
@@ -355,11 +340,7 @@ gst_funnel_src_event (GstPad * pad, GstEvent * event)
gboolean done = FALSE;
GValue value = { 0, };
- funnel = gst_pad_get_parent_element (pad);
- if (G_UNLIKELY (funnel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ funnel = GST_ELEMENT_CAST (GST_PAD_PARENT (pad));
iter = gst_element_iterate_sink_pads (funnel);
@@ -384,7 +365,6 @@ gst_funnel_src_event (GstPad * pad, GstEvent * event)
}
g_value_unset (&value);
gst_iterator_free (iter);
- gst_object_unref (funnel);
gst_event_unref (event);
return result;
diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
index d6d171117..a20c15ed4 100644
--- a/plugins/elements/gstinputselector.c
+++ b/plugins/elements/gstinputselector.c
@@ -336,9 +336,7 @@ gst_selector_pad_iterate_linked_pads (GstPad * pad)
GstIterator *it = NULL;
GValue val = { 0, };
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL))
- return NULL;
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
otherpad = gst_input_selector_get_linked_pad (sel, pad, TRUE);
if (otherpad) {
@@ -348,7 +346,6 @@ gst_selector_pad_iterate_linked_pads (GstPad * pad)
g_value_unset (&val);
gst_object_unref (otherpad);
}
- gst_object_unref (sel);
return it;
}
@@ -363,11 +360,7 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
GstPad *prev_active_sinkpad;
GstPad *active_sinkpad;
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
selpad = GST_SELECTOR_PAD_CAST (pad);
GST_INPUT_SELECTOR_LOCK (sel);
@@ -485,8 +478,6 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
} else
gst_event_unref (event);
- gst_object_unref (sel);
-
return res;
}
@@ -494,11 +485,6 @@ static gboolean
gst_selector_pad_query (GstPad * pad, GstQuery * query)
{
gboolean res = FALSE;
- GstInputSelector *sel;
-
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL))
- return FALSE;
switch (GST_QUERY_TYPE (query)) {
default:
@@ -506,8 +492,6 @@ gst_selector_pad_query (GstPad * pad, GstQuery * query)
break;
}
- gst_object_unref (sel);
-
return res;
}
@@ -635,7 +619,7 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
GstSegment *seg;
GstEvent *start_event = NULL;
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
selpad = GST_SELECTOR_PAD_CAST (pad);
seg = &selpad->segment;
@@ -721,7 +705,6 @@ gst_selector_pad_chain (GstPad * pad, GstBuffer * buf)
selpad->pushed = TRUE;
done:
- gst_object_unref (sel);
return res;
/* dropped buffers */
@@ -1050,12 +1033,7 @@ gst_input_selector_event (GstPad * pad, GstEvent * event)
GstPad *eventpad;
GList *pushed_pads = NULL;
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
-
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
/* Send upstream events to all sinkpads */
iter = gst_element_iterate_sink_pads (GST_ELEMENT_CAST (sel));
@@ -1110,9 +1088,7 @@ gst_input_selector_query (GstPad * pad, GstQuery * query)
gboolean res = FALSE;
GstInputSelector *sel;
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL))
- return FALSE;
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_LATENCY:
@@ -1174,8 +1150,6 @@ gst_input_selector_query (GstPad * pad, GstQuery * query)
break;
}
- gst_object_unref (sel);
-
return res;
}
diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c
index 2298de0b4..096f72a0b 100644
--- a/plugins/elements/gstmultiqueue.c
+++ b/plugins/elements/gstmultiqueue.c
@@ -580,7 +580,7 @@ gst_multi_queue_iterate_internal_links (GstPad * pad)
GstIterator *it = NULL;
GstPad *opad;
GstSingleQueue *squeue;
- GstMultiQueue *mq = GST_MULTI_QUEUE (gst_pad_get_parent (pad));
+ GstMultiQueue *mq = GST_MULTI_QUEUE (GST_PAD_PARENT (pad));
GValue val = { 0, };
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
@@ -604,7 +604,6 @@ gst_multi_queue_iterate_internal_links (GstPad * pad)
out:
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
- gst_object_unref (mq);
return it;
}
@@ -1412,7 +1411,7 @@ gst_multi_queue_sink_event (GstPad * pad, GstEvent * event)
GstEvent *sref = NULL;
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
- mq = (GstMultiQueue *) gst_pad_get_parent (pad);
+ mq = (GstMultiQueue *) GST_PAD_PARENT (pad);
type = GST_EVENT_TYPE (event);
@@ -1483,7 +1482,6 @@ gst_multi_queue_sink_event (GstPad * pad, GstEvent * event)
break;
}
done:
- gst_object_unref (mq);
return res;
flushing:
diff --git a/plugins/elements/gstoutputselector.c b/plugins/elements/gstoutputselector.c
index 677e9f4d8..b4414b63c 100644
--- a/plugins/elements/gstoutputselector.c
+++ b/plugins/elements/gstoutputselector.c
@@ -421,7 +421,7 @@ gst_output_selector_chain (GstPad * pad, GstBuffer * buf)
GstOutputSelector *osel;
GstClockTime position, duration;
- osel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
+ osel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
/*
* The _switch function might push a buffer if 'resend-latest' is true.
@@ -465,7 +465,6 @@ gst_output_selector_chain (GstPad * pad, GstBuffer * buf)
GST_LOG_OBJECT (osel, "pushing buffer to %" GST_PTR_FORMAT,
osel->active_srcpad);
res = gst_pad_push (osel->active_srcpad, buf);
- gst_object_unref (osel);
return res;
}
@@ -506,11 +505,7 @@ gst_output_selector_event (GstPad * pad, GstEvent * event)
GstOutputSelector *sel;
GstPad *active = NULL;
- sel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ sel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CAPS:
@@ -564,8 +559,6 @@ gst_output_selector_event (GstPad * pad, GstEvent * event)
}
}
- gst_object_unref (sel);
-
return res;
}
@@ -576,10 +569,7 @@ gst_output_selector_query (GstPad * pad, GstQuery * query)
GstOutputSelector *sel;
GstPad *active = NULL;
- sel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL)) {
- return FALSE;
- }
+ sel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
@@ -608,7 +598,5 @@ gst_output_selector_query (GstPad * pad, GstQuery * query)
break;
}
- gst_object_unref (sel);
-
return res;
}
diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c
index c79fb3585..d5db7b566 100644
--- a/plugins/elements/gstqueue.c
+++ b/plugins/elements/gstqueue.c
@@ -462,7 +462,7 @@ gst_queue_link_src (GstPad * pad, GstPad * peer)
GstPadLinkReturn result = GST_PAD_LINK_OK;
GstQueue *queue;
- queue = GST_QUEUE (gst_pad_get_parent (pad));
+ queue = GST_QUEUE (GST_PAD_PARENT (pad));
GST_DEBUG_OBJECT (queue, "queue linking source pad");
@@ -482,7 +482,6 @@ gst_queue_link_src (GstPad * pad, GstPad * peer)
}
GST_QUEUE_MUTEX_UNLOCK (queue);
}
- gst_object_unref (queue);
return result;
}
@@ -729,11 +728,7 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
{
GstQueue *queue;
- queue = GST_QUEUE (gst_pad_get_parent (pad));
- if (G_UNLIKELY (queue == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ queue = GST_QUEUE (GST_PAD_PARENT (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
@@ -794,7 +789,6 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
break;
}
done:
- gst_object_unref (queue);
return TRUE;
/* ERRORS */
@@ -803,7 +797,6 @@ out_flushing:
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"refusing event, we are flushing");
GST_QUEUE_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
gst_event_unref (event);
return FALSE;
}
@@ -811,7 +804,6 @@ out_eos:
{
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "refusing event, we are EOS");
GST_QUEUE_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
gst_event_unref (event);
return FALSE;
}
@@ -820,12 +812,9 @@ out_eos:
static gboolean
gst_queue_handle_sink_query (GstPad * pad, GstQuery * query)
{
- GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
+ GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
gboolean res;
- if (G_UNLIKELY (queue == NULL))
- return FALSE;
-
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_ACCEPT_CAPS:
case GST_QUERY_CAPS:
@@ -834,7 +823,6 @@ gst_queue_handle_sink_query (GstPad * pad, GstQuery * query)
res = gst_pad_query_default (pad, query);
break;
}
- gst_object_unref (queue);
return res;
}
@@ -1213,12 +1201,8 @@ static gboolean
gst_queue_handle_src_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
- GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
+ GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
- if (G_UNLIKELY (queue == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
#ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)",
event, GST_EVENT_TYPE (event));
@@ -1226,22 +1210,17 @@ gst_queue_handle_src_event (GstPad * pad, GstEvent * event)
res = gst_pad_push_event (queue->sinkpad, event);
- gst_object_unref (queue);
return res;
}
static gboolean
gst_queue_handle_src_query (GstPad * pad, GstQuery * query)
{
- GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
+ GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
gboolean res;
- if (G_UNLIKELY (queue == NULL))
- return FALSE;
-
res = gst_pad_peer_query (queue->sinkpad, query);
if (!res) {
- gst_object_unref (queue);
return FALSE;
}
@@ -1299,7 +1278,6 @@ gst_queue_handle_src_query (GstPad * pad, GstQuery * query)
break;
}
- gst_object_unref (queue);
return TRUE;
}
@@ -1309,7 +1287,7 @@ gst_queue_sink_activate_push (GstPad * pad, gboolean active)
gboolean result = TRUE;
GstQueue *queue;
- queue = GST_QUEUE (gst_pad_get_parent (pad));
+ queue = GST_QUEUE (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE_MUTEX_LOCK (queue);
@@ -1325,8 +1303,6 @@ gst_queue_sink_activate_push (GstPad * pad, gboolean active)
GST_QUEUE_MUTEX_UNLOCK (queue);
}
- gst_object_unref (queue);
-
return result;
}
@@ -1336,7 +1312,7 @@ gst_queue_src_activate_push (GstPad * pad, gboolean active)
gboolean result = FALSE;
GstQueue *queue;
- queue = GST_QUEUE (gst_pad_get_parent (pad));
+ queue = GST_QUEUE (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE_MUTEX_LOCK (queue);
@@ -1363,8 +1339,6 @@ gst_queue_src_activate_push (GstPad * pad, gboolean active)
result = gst_pad_stop_task (pad);
}
- gst_object_unref (queue);
-
return result;
}
diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c
index f4a673749..1ecd308ee 100644
--- a/plugins/elements/gstqueue2.c
+++ b/plugins/elements/gstqueue2.c
@@ -2017,19 +2017,12 @@ static gboolean
gst_queue2_handle_sink_query (GstPad * pad, GstQuery * query)
{
gboolean res;
- GstQueue2 *queue;
-
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
- if (G_UNLIKELY (queue == NULL))
- return FALSE;
switch (GST_QUERY_TYPE (query)) {
default:
res = gst_pad_query_default (pad, query);
break;
}
- gst_object_unref (queue);
-
return res;
}
@@ -2329,12 +2322,8 @@ static gboolean
gst_queue2_handle_src_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
- GstQueue2 *queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ GstQueue2 *queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
- if (G_UNLIKELY (queue == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
#ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%s)",
event, GST_EVENT_TYPE_NAME (event));
@@ -2384,7 +2373,6 @@ gst_queue2_handle_src_event (GstPad * pad, GstEvent * event)
break;
}
- gst_object_unref (queue);
return res;
}
@@ -2393,9 +2381,7 @@ gst_queue2_handle_src_query (GstPad * pad, GstQuery * query)
{
GstQueue2 *queue;
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
- if (G_UNLIKELY (queue == NULL))
- return FALSE;
+ queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
@@ -2574,14 +2560,12 @@ gst_queue2_handle_src_query (GstPad * pad, GstQuery * query)
break;
}
- gst_object_unref (queue);
return TRUE;
/* ERRORS */
peer_failed:
{
GST_DEBUG_OBJECT (queue, "failed peer query");
- gst_object_unref (queue);
return FALSE;
}
}
@@ -2612,7 +2596,7 @@ gst_queue2_get_range (GstPad * pad, guint64 offset, guint length,
GstQueue2 *queue;
GstFlowReturn ret;
- queue = GST_QUEUE2_CAST (gst_pad_get_parent (pad));
+ queue = GST_QUEUE2_CAST (GST_PAD_PARENT (pad));
length = (length == -1) ? DEFAULT_BUFFER_SIZE : length;
GST_QUEUE2_MUTEX_LOCK_CHECK (queue, queue->srcresult, out_flushing);
@@ -2644,8 +2628,6 @@ gst_queue2_get_range (GstPad * pad, guint64 offset, guint length,
ret = gst_queue2_create_read (queue, offset, length, buffer);
GST_QUEUE2_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
-
return ret;
/* ERRORS */
@@ -2655,14 +2637,12 @@ out_flushing:
GST_DEBUG_OBJECT (queue, "we are flushing");
GST_QUEUE2_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
return ret;
}
out_unexpected:
{
GST_DEBUG_OBJECT (queue, "read beyond end of file");
GST_QUEUE2_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
return GST_FLOW_EOS;
}
}
@@ -2674,7 +2654,7 @@ gst_queue2_sink_activate_push (GstPad * pad, gboolean active)
gboolean result = TRUE;
GstQueue2 *queue;
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE2_MUTEX_LOCK (queue);
@@ -2695,8 +2675,6 @@ gst_queue2_sink_activate_push (GstPad * pad, gboolean active)
GST_QUEUE2_MUTEX_UNLOCK (queue);
}
- gst_object_unref (queue);
-
return result;
}
@@ -2708,7 +2686,7 @@ gst_queue2_src_activate_push (GstPad * pad, gboolean active)
gboolean result = FALSE;
GstQueue2 *queue;
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE2_MUTEX_LOCK (queue);
@@ -2733,8 +2711,6 @@ gst_queue2_src_activate_push (GstPad * pad, gboolean active)
result = gst_pad_stop_task (pad);
}
- gst_object_unref (queue);
-
return result;
}
@@ -2745,7 +2721,7 @@ gst_queue2_src_activate_pull (GstPad * pad, gboolean active)
gboolean result;
GstQueue2 *queue;
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE2_MUTEX_LOCK (queue);
@@ -2786,7 +2762,6 @@ gst_queue2_src_activate_pull (GstPad * pad, gboolean active)
result = TRUE;
GST_QUEUE2_MUTEX_UNLOCK (queue);
}
- gst_object_unref (queue);
return result;
}
diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c
index 42540fea3..bf7be8029 100644
--- a/plugins/elements/gsttee.c
+++ b/plugins/elements/gsttee.c
@@ -708,7 +708,7 @@ gst_tee_chain_list (GstPad * pad, GstBufferList * list)
GstFlowReturn res;
GstTee *tee;
- tee = GST_TEE_CAST (gst_pad_get_parent (pad));
+ tee = GST_TEE_CAST (GST_PAD_PARENT (pad));
GST_DEBUG_OBJECT (tee, "received list %p", list);
@@ -716,8 +716,6 @@ gst_tee_chain_list (GstPad * pad, GstBufferList * list)
GST_DEBUG_OBJECT (tee, "handled list %s", gst_flow_get_name (res));
- gst_object_unref (tee);
-
return res;
}
@@ -754,7 +752,7 @@ gst_tee_src_activate_pull (GstPad * pad, gboolean active)
gboolean res;
GstPad *sinkpad;
- tee = GST_TEE (gst_pad_get_parent (pad));
+ tee = GST_TEE (GST_PAD_PARENT (pad));
GST_OBJECT_LOCK (tee);
@@ -785,8 +783,6 @@ gst_tee_src_activate_pull (GstPad * pad, gboolean active)
tee->sink_mode = active & GST_PAD_ACTIVATE_PULL;
GST_OBJECT_UNLOCK (tee);
- gst_object_unref (tee);
-
return res;
/* ERRORS */
@@ -795,7 +791,6 @@ cannot_pull:
GST_OBJECT_UNLOCK (tee);
GST_INFO_OBJECT (tee, "Cannot activate in pull mode, pull-mode "
"set to NEVER");
- gst_object_unref (tee);
return FALSE;
}
cannot_pull_multiple_srcs:
@@ -803,14 +798,12 @@ cannot_pull_multiple_srcs:
GST_OBJECT_UNLOCK (tee);
GST_INFO_OBJECT (tee, "Cannot activate multiple src pads in pull mode, "
"pull-mode set to SINGLE");
- gst_object_unref (tee);
return FALSE;
}
sink_activate_failed:
{
GST_INFO_OBJECT (tee, "Failed to %sactivate sink pad in pull mode",
active ? "" : "de");
- gst_object_unref (tee);
return FALSE;
}
}
@@ -822,7 +815,7 @@ gst_tee_src_query (GstPad * pad, GstQuery * query)
gboolean res;
GstPad *sinkpad;
- tee = GST_TEE (gst_pad_get_parent (pad));
+ tee = GST_TEE (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_SCHEDULING:
@@ -858,8 +851,6 @@ gst_tee_src_query (GstPad * pad, GstQuery * query)
break;
}
- gst_object_unref (tee);
-
return res;
}
@@ -890,7 +881,7 @@ gst_tee_src_get_range (GstPad * pad, guint64 offset, guint length,
GstTee *tee;
GstFlowReturn ret;
- tee = GST_TEE (gst_pad_get_parent (pad));
+ tee = GST_TEE (GST_PAD_PARENT (pad));
ret = gst_pad_pull_range (tee->sinkpad, offset, length, buf);
@@ -899,7 +890,5 @@ gst_tee_src_get_range (GstPad * pad, guint64 offset, guint length,
else if (ret == GST_FLOW_EOS)
gst_tee_pull_eos (tee);
- gst_object_unref (tee);
-
return ret;
}
diff --git a/plugins/elements/gstvalve.c b/plugins/elements/gstvalve.c
index dcbf18693..1a04061ff 100644
--- a/plugins/elements/gstvalve.c
+++ b/plugins/elements/gstvalve.c
@@ -198,9 +198,7 @@ gst_valve_sink_event (GstPad * pad, GstEvent * event)
GstValve *valve;
gboolean ret = TRUE;
- valve = GST_VALVE (gst_pad_get_parent (pad));
- if (valve == NULL)
- return FALSE;
+ valve = GST_VALVE (GST_PAD_PARENT (pad));
if (g_atomic_int_get (&valve->drop))
gst_event_unref (event);
@@ -213,7 +211,6 @@ gst_valve_sink_event (GstPad * pad, GstEvent * event)
if (g_atomic_int_get (&valve->drop))
ret = TRUE;
- gst_object_unref (valve);
return ret;
}
@@ -224,9 +221,7 @@ gst_valve_query (GstPad * pad, GstQuery * query)
gboolean res;
GstPad *otherpad;
- valve = GST_VALVE (gst_pad_get_parent (pad));
- if (valve == NULL)
- return FALSE;
+ valve = GST_VALVE (GST_PAD_PARENT (pad));
otherpad = (pad == valve->sinkpad ? valve->srcpad : valve->sinkpad);
@@ -240,7 +235,5 @@ gst_valve_query (GstPad * pad, GstQuery * query)
break;
}
- gst_object_unref (valve);
-
return res;
}