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); GST_PROXY_LOCK (gpad);
internal = GST_PROXY_PAD_INTERNAL (gpad); internal = GST_PROXY_PAD_INTERNAL (gpad);
g_assert (internal);
if (newtarget) if (newtarget)
GST_DEBUG_OBJECT (gpad, "set target %s:%s", GST_DEBUG_PAD_NAME (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); (gpointer) on_src_target_notify, gpad);
} }
/* if we have an internal pad, unlink */ /* unlink internal pad */
if (internal) { if (GST_PAD_IS_SRC (internal))
if (GST_PAD_IS_SRC (internal)) gst_pad_unlink (internal, oldtarget);
gst_pad_unlink (internal, oldtarget); else
else gst_pad_unlink (oldtarget, internal);
gst_pad_unlink (oldtarget, internal);
}
} }
result = gst_proxy_pad_set_target_unlocked (GST_PAD_CAST (gpad), newtarget); result = gst_proxy_pad_set_target_unlocked (GST_PAD_CAST (gpad), newtarget);