+2004-12-16 Christophe Fergeau <teuf@gnome.org>
+
+ Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
+ * gst/playback/gstdecodebin.c: (new_pad), (close_link):
+ * gst/playback/gstplaybasebin.c: (new_decoded_pad):
+ Fix memleaks (#157233).
+
2004-12-16 Sebastien Cote <sc5@hermes.usherb.ca>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
new_pad (GstElement * element, GstPad * pad, GstDynamic * dynamic)
{
GstDecodeBin *decode_bin = dynamic->decode_bin;
+ GstCaps *caps;
/* see if any more pending dynamic connections exist */
gboolean more = gst_decode_bin_is_dynamic (decode_bin);
- close_pad_link (element, pad, gst_pad_get_caps (pad), decode_bin, more);
+ caps = gst_pad_get_caps (pad);
+ close_pad_link (element, pad, caps, decode_bin, more);
+ if (caps)
+ gst_caps_free (caps);
}
/* this signal is fired when an element signals the no_more_pads signal.
/* now loop over all the pads we need to connect */
for (pads = to_connect; pads; pads = g_list_next (pads)) {
GstPad *pad = GST_PAD (pads->data);
+ GstCaps *caps;
/* we have more pads if we have more than 1 pad to connect or
* dynamics. If we have only 1 pad and no dynamics, more will be
gst_pad_get_name (pad));
/* continue autoplugging on the pads */
- close_pad_link (element, pad, gst_pad_get_caps (pad), decode_bin, more);
+ caps = gst_pad_get_caps (pad);
+ close_pad_link (element, pad, caps, decode_bin, more);
+ if (caps)
+ gst_caps_free (caps);
}
g_list_free (to_connect);
caps = gst_pad_get_caps (pad);
if (caps == NULL || gst_caps_is_empty (caps)) {
g_warning ("no type on pad %s:%s", GST_DEBUG_PAD_NAME (pad));
+ if (caps)
+ gst_caps_free (caps);
return;
}
}
/* add the stream to the list */
info = gst_stream_info_new (GST_OBJECT (srcpad), type, NULL, caps);
+ gst_caps_free (caps);
info->origin = GST_OBJECT (pad);
add_stream (group, info);