openal: Unref pad template caps after usage

https://bugzilla.gnome.org/show_bug.cgi?id=734520
This commit is contained in:
Sebastian Rasmussen 2014-08-09 01:27:53 +02:00 committed by Tim-Philipp Müller
parent 2f8e528f37
commit b53433fbbf
2 changed files with 7 additions and 2 deletions

View file

@ -575,7 +575,9 @@ gst_openal_sink_getcaps (GstBaseSink * basesink, GstCaps * filter)
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 {

View file

@ -335,9 +335,12 @@ gst_openal_src_getcaps (GstBaseSrc * basesrc, GstCaps * filter)
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 {