if (sink->default_device == NULL) {
GstPad *pad = GST_BASE_SINK_PAD (basesink);
- caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+ GstCaps *tcaps = gst_pad_get_pad_template_caps (pad);
+ caps = gst_caps_copy (tcaps);
+ gst_caps_unref (tcaps);
} else if (sink->probed_caps)
caps = gst_caps_copy (sink->probed_caps);
else {
if (device == NULL) {
GstPad *pad = GST_BASE_SRC_PAD (basesrc);
+ GstCaps *tcaps = gst_pad_get_pad_template_caps (pad);
+
GST_ELEMENT_WARNING (openalsrc, RESOURCE, OPEN_WRITE,
("Could not open temporary device."), GST_ALC_ERROR (device));
- caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+ caps = gst_caps_copy (tcaps);
+ gst_caps_unref (tcaps);
} else if (openalsrc->probed_caps)
caps = gst_caps_copy (openalsrc->probed_caps);
else {