Also clear cached connection filter when relinking pads with the clear-flag set.

Original commit message from CVS:
Also clear cached connection filter when relinking pads with the clear-flag
set.
This commit is contained in:
Wim Taymans 2003-01-23 19:46:38 +00:00
parent 8a2381a8ad
commit 84c67b8f69

View file

@ -1467,7 +1467,7 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
*/
static gboolean
gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
GstCaps *filtercaps, gboolean clear)
GstCaps *filtercaps, gboolean clear)
{
GstCaps *srccaps, *sinkcaps;
GstCaps *intersection = NULL;
@ -1485,8 +1485,11 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
"start relink filtered %s:%s and %s:%s, clearing caps",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
/* FIXME does this leak? */
GST_PAD_CAPS (GST_PAD (realsrc)) = NULL;
GST_PAD_CAPS (GST_PAD (realsink)) = NULL;
GST_RPAD_FILTER (realsrc) = NULL;
GST_RPAD_FILTER (realsink) = NULL;
}
else {
GST_INFO (GST_CAT_PADS, "start relink filtered %s:%s and %s:%s",
@ -1522,8 +1525,10 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
/* then filter this against the app filter */
if (filtercaps) {
GstCaps *filtered_intersection = gst_caps_intersect (intersection,
filtercaps);
GstCaps *filtered_intersection;
filtered_intersection = gst_caps_intersect (intersection,
filtercaps);
/* get rid of the old intersection here */
gst_caps_unref (intersection);
@ -1577,6 +1582,9 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
g_return_val_if_fail (GST_RPAD_PEER (realsrc) != NULL, FALSE);
g_return_val_if_fail (GST_RPAD_PEER (realsink) == realsrc, FALSE);
GST_INFO (GST_CAT_PADS, "perform negotiate for link %s:%s-%s:%s",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
filter = GST_RPAD_APPFILTER (realsrc);
if (filter) {
GST_INFO (GST_CAT_PADS, "dumping filter for link %s:%s-%s:%s",
@ -1897,6 +1905,7 @@ gst_pad_recalc_allowed_caps (GstPad *pad)
GST_DEBUG (GST_CAT_PROPERTIES, "set allowed caps of %s:%s",
GST_DEBUG_PAD_NAME (pad));
peer = GST_RPAD_PEER (pad);
if (peer)
return gst_pad_try_relink_filtered (pad, GST_PAD (peer),