From f6fc1774b94f2d2e444ca38faa7102fcd1dc6334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 27 Sep 2017 13:32:34 +0200 Subject: [PATCH] vaapipostproc: use scoped variable for return value Instead of reusing a parameter variable for the return value of gst_vaapipostproc_fixate_caps(), this patch uses the function scoped pointer. Thus, the code is cleaner. https://bugzilla.gnome.org/show_bug.cgi?id=785706 --- gst/vaapi/gstvaapipostproc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index 241a4efd81..b984f33c1f 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -1158,24 +1158,22 @@ gst_vaapipostproc_fixate_caps (GstBaseTransform * trans, if (direction == GST_PAD_SRC) { /* @TODO: we can do better */ - othercaps = gst_caps_fixate (othercaps); + outcaps = gst_caps_fixate (othercaps); goto done; } g_mutex_lock (&postproc->postproc_lock); - if ((outcaps = gst_vaapipostproc_fixate_srccaps (postproc, caps, othercaps))) - gst_caps_replace (&othercaps, outcaps); + outcaps = gst_vaapipostproc_fixate_srccaps (postproc, caps, othercaps); g_mutex_unlock (&postproc->postproc_lock); /* set passthrough according to caps changes or filter changes */ gst_vaapipostproc_set_passthrough (trans); done: - GST_DEBUG_OBJECT (trans, "fixated othercaps to %" GST_PTR_FORMAT, othercaps); - if (outcaps) - gst_caps_unref (outcaps); + GST_DEBUG_OBJECT (trans, "fixated othercaps to %" GST_PTR_FORMAT, outcaps); + gst_caps_unref (othercaps); - return othercaps; + return outcaps; } static gboolean