summaryrefslogtreecommitdiff
path: root/gst/autoconvert
diff options
context:
space:
mode:
Diffstat (limited to 'gst/autoconvert')
-rw-r--r--gst/autoconvert/gstautoconvert.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c
index ebe297c11..97bd8b445 100644
--- a/gst/autoconvert/gstautoconvert.c
+++ b/gst/autoconvert/gstautoconvert.c
@@ -576,6 +576,7 @@ gst_auto_convert_add_element (GstAutoConvert * autoconvert,
if (!sinkpad) {
GST_ERROR_OBJECT (autoconvert, "Could not find sink in %s",
GST_OBJECT_NAME (element));
+ gst_object_unref (srcpad);
goto error;
}
@@ -652,6 +653,9 @@ gst_auto_convert_add_element (GstAutoConvert * autoconvert,
/* Increment the reference count we will return to the caller */
gst_object_ref (element);
+ /* unref sink and src pad */
+ gst_object_unref (srcpad);
+ gst_object_unref (sinkpad);
return element;
error:
@@ -879,6 +883,8 @@ gst_auto_convert_sink_setcaps (GstPad * pad, GstCaps * caps)
/* And make it the current child */
if (gst_auto_convert_activate_element (autoconvert, element, caps))
break;
+ else
+ gst_object_unref (element);
}
get_out: