fix wrong caps refcount handling of filtered caps in cornercases.

Original commit message from CVS:
fix wrong caps refcount handling of filtered caps in cornercases.
This commit is contained in:
Benjamin Otte 2003-05-18 03:22:04 +00:00
parent 0e22bceb5d
commit c51366dc49

View file

@ -972,7 +972,7 @@ gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad)
* @filtercaps: the filter #GstCaps. * @filtercaps: the filter #GstCaps.
* *
* Links the source pad and the sink pad, constrained * Links the source pad and the sink pad, constrained
* by the given filter caps. * by the given filter caps. This function sinks the caps.
* *
* Returns: TRUE if the pads have been linked, FALSE otherwise. * Returns: TRUE if the pads have been linked, FALSE otherwise.
*/ */
@ -1521,7 +1521,6 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
"start relink filtered %s:%s and %s:%s, clearing caps", "start relink filtered %s:%s and %s:%s, clearing caps",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink)); GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
/* FIXME does this leak? */
gst_caps_replace (&GST_PAD_CAPS (GST_PAD (realsrc)), NULL); gst_caps_replace (&GST_PAD_CAPS (GST_PAD (realsrc)), NULL);
gst_caps_replace (&GST_PAD_CAPS (GST_PAD (realsink)), NULL); gst_caps_replace (&GST_PAD_CAPS (GST_PAD (realsink)), NULL);
gst_caps_replace (&GST_RPAD_FILTER (realsrc), NULL); gst_caps_replace (&GST_RPAD_FILTER (realsrc), NULL);
@ -1573,7 +1572,7 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
filtered_intersection = gst_caps_intersect (intersection, filtered_intersection = gst_caps_intersect (intersection,
filtercaps); filtercaps);
gst_caps_unref (intersection); gst_caps_sink (intersection);
if (!filtered_intersection) { if (!filtered_intersection) {
GST_INFO (GST_CAT_PADS, GST_INFO (GST_CAT_PADS,
@ -1595,7 +1594,7 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
* are equal to the same thing on both */ * are equal to the same thing on both */
gst_caps_replace_sink (&GST_RPAD_FILTER (realsrc), intersection); gst_caps_replace_sink (&GST_RPAD_FILTER (realsrc), intersection);
gst_caps_replace_sink (&GST_RPAD_FILTER (realsink), intersection); gst_caps_replace_sink (&GST_RPAD_FILTER (realsink), intersection);
gst_caps_unref (intersection); gst_caps_sink (intersection);
return gst_pad_perform_negotiate (GST_PAD (realsrc), GST_PAD (realsink)); return gst_pad_perform_negotiate (GST_PAD (realsrc), GST_PAD (realsink));
} }