mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
ghostpad: don't unref NULL caps
Caps can be NULL so don't call unref on it unconditionally, instead use an existing exit pad for the function.
This commit is contained in:
parent
8d1aeeb2af
commit
6a872b0b14
1 changed files with 3 additions and 4 deletions
|
@ -718,8 +718,7 @@ on_src_target_notify (GstPad * target, GParamSpec * unused, gpointer user_data)
|
||||||
/* First check if the peer is still available and our proxy pad */
|
/* First check if the peer is still available and our proxy pad */
|
||||||
if (!GST_PAD_PEER (target) || !GST_IS_PROXY_PAD (GST_PAD_PEER (target))) {
|
if (!GST_PAD_PEER (target) || !GST_IS_PROXY_PAD (GST_PAD_PEER (target))) {
|
||||||
GST_OBJECT_UNLOCK (target);
|
GST_OBJECT_UNLOCK (target);
|
||||||
gst_caps_unref (caps);
|
goto done;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proxypad = GST_PROXY_PAD (GST_PAD_PEER (target));
|
proxypad = GST_PROXY_PAD (GST_PAD_PEER (target));
|
||||||
|
@ -730,8 +729,7 @@ on_src_target_notify (GstPad * target, GParamSpec * unused, gpointer user_data)
|
||||||
!GST_IS_GHOST_PAD (GST_PROXY_PAD_INTERNAL (proxypad))) {
|
!GST_IS_GHOST_PAD (GST_PROXY_PAD_INTERNAL (proxypad))) {
|
||||||
GST_OBJECT_UNLOCK (target);
|
GST_OBJECT_UNLOCK (target);
|
||||||
GST_PROXY_UNLOCK (proxypad);
|
GST_PROXY_UNLOCK (proxypad);
|
||||||
gst_caps_unref (caps);
|
goto done;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
gpad = GST_GHOST_PAD (GST_PROXY_PAD_INTERNAL (proxypad));
|
gpad = GST_GHOST_PAD (GST_PROXY_PAD_INTERNAL (proxypad));
|
||||||
g_object_ref (gpad);
|
g_object_ref (gpad);
|
||||||
|
@ -751,6 +749,7 @@ on_src_target_notify (GstPad * target, GParamSpec * unused, gpointer user_data)
|
||||||
|
|
||||||
g_object_unref (gpad);
|
g_object_unref (gpad);
|
||||||
|
|
||||||
|
done:
|
||||||
if (caps)
|
if (caps)
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue