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.
This commit is contained in:
Stefan Kost 2009-02-04 17:20:21 +02:00
parent 726a2fbff6
commit 2246b477bb

View file

@ -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,14 +1119,12 @@ gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget)
(gpointer) on_src_target_notify, gpad);
}
/* if we have an internal pad, unlink */
if (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);