From a424fb289bbb554f8a5d74a963d22d31ddad8ae1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 2 Dec 2013 00:10:43 +0000 Subject: [PATCH] deinterlace: microoptimisation: avoid some unnecessary GValue copies --- gst/deinterlace/gstdeinterlace.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index e13c41b..32c5587 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -2208,11 +2208,10 @@ gst_deinterlace_getcaps (GstDeinterlace * self, GstPad * pad, GstCaps * filter) gst_value_set_fraction (&nmax, n, d); gst_value_set_fraction_range (&nrange, &nmin, &nmax); - gst_structure_set_value (s, "framerate", &nrange); + gst_structure_take_value (s, "framerate", &nrange); g_value_unset (&nmin); g_value_unset (&nmax); - g_value_unset (&nrange); } else if (G_VALUE_TYPE (val) == GST_TYPE_LIST) { const GValue *lval; GValue nlist = { 0, }; @@ -2240,11 +2239,9 @@ gst_deinterlace_getcaps (GstDeinterlace * self, GstPad * pad, GstCaps * filter) g_value_init (&nval, GST_TYPE_FRACTION); gst_value_set_fraction (&nval, n, d); - gst_value_list_append_value (&nlist, &nval); - g_value_unset (&nval); + gst_value_list_append_and_take_value (&nlist, &nval); } - gst_structure_set_value (s, "framerate", &nlist); - g_value_unset (&nlist); + gst_structure_take_value (s, "framerate", &nlist); } } } -- 2.7.4