From 2246b477bb39176be59b65bc486e380edb38a227 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 4 Feb 2009 17:20:21 +0200 Subject: [PATCH] cleanup: Either check always for internal being NULL or don't. IMHO the ghostpad is borked if internal is NULL. So the check can go and it is used later unchecked anyway. --- gst/gstghostpad.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 91524145ee..694f673711 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -1105,6 +1105,7 @@ gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget) GST_PROXY_LOCK (gpad); internal = GST_PROXY_PAD_INTERNAL (gpad); + g_assert (internal); if (newtarget) GST_DEBUG_OBJECT (gpad, "set target %s:%s", GST_DEBUG_PAD_NAME (newtarget)); @@ -1118,13 +1119,11 @@ gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget) (gpointer) on_src_target_notify, gpad); } - /* if we have an internal pad, unlink */ - if (internal) { - if (GST_PAD_IS_SRC (internal)) - gst_pad_unlink (internal, oldtarget); - else - gst_pad_unlink (oldtarget, internal); - } + /* unlink internal pad */ + if (GST_PAD_IS_SRC (internal)) + gst_pad_unlink (internal, oldtarget); + else + gst_pad_unlink (oldtarget, internal); } result = gst_proxy_pad_set_target_unlocked (GST_PAD_CAST (gpad), newtarget);