diff --git a/ext/jp2k/gstjasperdec.c b/ext/jp2k/gstjasperdec.c index e896142bdb..0c69db3e38 100644 --- a/ext/jp2k/gstjasperdec.c +++ b/ext/jp2k/gstjasperdec.c @@ -324,7 +324,6 @@ gst_jasper_dec_negotiate (GstJasperDec * dec, jas_image_t * image) } /* avoid lists of fourcc, etc */ allowed_caps = gst_caps_normalize (caps); - gst_caps_unref (caps); caps = NULL; GST_LOG_OBJECT (dec, "allowed source caps %" GST_PTR_FORMAT, allowed_caps); diff --git a/sys/d3dvideosink/d3dvideosink.c b/sys/d3dvideosink/d3dvideosink.c index a327802881..bafb907312 100644 --- a/sys/d3dvideosink/d3dvideosink.c +++ b/sys/d3dvideosink/d3dvideosink.c @@ -447,7 +447,7 @@ static GstCaps * gst_d3dvideosink_get_caps (GstBaseSink * basesink) { GstD3DVideoSink *sink = GST_D3DVIDEOSINK (basesink); - GstCaps *caps = gst_caps_new_empty (); + GstCaps *caps; const GstCaps *tempCaps = gst_pad_get_pad_template_caps (GST_VIDEO_SINK_PAD (sink)); @@ -457,11 +457,13 @@ gst_d3dvideosink_get_caps (GstBaseSink * basesink) if (FAILED (IDirect3D9_GetAdapterDisplayMode (shared.d3d, D3DADAPTER_DEFAULT, &d3ddm))) { GST_WARNING ("Unable to request adapter display mode"); - gst_caps_unref (caps); - caps = gst_caps_copy (tempCaps); + caps = tempCaps; } else { gint i; - GstCaps *c = gst_caps_normalize (tempCaps); + GstCaps *c; + + caps = gst_caps_new_empty (); + c = gst_caps_normalize (tempCaps); for (i = 0; i < gst_caps_get_size (c); i++) { D3DFORMAT d3dfourcc = 0; @@ -489,8 +491,7 @@ gst_d3dvideosink_get_caps (GstBaseSink * basesink) gst_caps_unref (c); } } else { - gst_caps_unref (caps); - caps = gst_caps_copy (tempCaps); + caps = tempCaps; } return caps; } diff --git a/tests/check/pipelines/colorspace.c b/tests/check/pipelines/colorspace.c index 12ee1a7f2b..1cd24dc3a5 100644 --- a/tests/check/pipelines/colorspace.c +++ b/tests/check/pipelines/colorspace.c @@ -172,9 +172,8 @@ colorspace_compare (gint width, gint height, gboolean comp) gst_caps_unref (rcaps); /* normalize to finally have a list of acceptable fixed formats */ - tcaps = gst_caps_simplify (caps); - caps = gst_caps_normalize (tcaps); - gst_caps_unref (tcaps); + caps = gst_caps_simplify (caps); + caps = gst_caps_normalize (caps); /* set up for running stuff */ loop = g_main_loop_new (NULL, FALSE);