group->no_more_pads = TRUE;
}
+ /* From here on we own a reference to the caps as
+ * we might create new caps below and would need
+ * to unref them later */
+ if (caps)
+ gst_caps_ref (caps);
+
if ((caps == NULL) || gst_caps_is_empty (caps))
goto unknown_type;
if (!res)
goto unknown_type;
+ gst_caps_unref (caps);
+
return;
expose_pad:
GST_LOG_OBJECT (dbin, "Pad is final. autoplug-continue:%d", apcontinue);
expose_pad (dbin, src, dpad, pad, caps, chain);
gst_object_unref (dpad);
+ gst_caps_unref (caps);
return;
}
{
GST_LOG_OBJECT (pad, "Known type, but discarded because not final caps");
chain->deadend = TRUE;
- chain->endcaps = gst_caps_ref (caps);
+ chain->endcaps = caps;
gst_object_replace ((GstObject **) & chain->current_pad, NULL);
/* Try to expose anything */
GST_LOG_OBJECT (pad, "Unknown type, posting message and firing signal");
chain->deadend = TRUE;
- chain->endcaps = gst_caps_ref (caps);
+ chain->endcaps = caps;
gst_object_replace ((GstObject **) & chain->current_pad, NULL);
gst_element_post_message (GST_ELEMENT_CAST (dbin),
* we have to unref the pad */
if (is_parser_converter)
gst_object_unref (pad);
+ if (caps)
+ gst_caps_unref (caps);
return;
}