From: Víctor Manuel Jáquez Leal Date: Fri, 22 Sep 2017 16:59:49 +0000 (+0200) Subject: libs: display: initialize value if they are not yet X-Git-Tag: 1.19.3~503^2~832 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b23ccc69b035dc4d79b7411570debfe538928745;p=platform%2Fupstream%2Fgstreamer.git libs: display: initialize value if they are not yet This is a difference between the GObject API and the GstVaapi one: the GValue passed to get a property value, in GObject has to be initialized with g_value_init(), but in GstVaapi is has not. In order to overcome this mismatch, this patch call g_value_init() internally only in the passed one is not already initialized. https://bugzilla.gnome.org/show_bug.cgi?id=788058 --- diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index de31e01..1d34434 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -1002,14 +1002,16 @@ _get_property (GstVaapiDisplay * display, const GstVaapiProperty * prop, GstVaapiRenderMode mode; if (!gst_vaapi_display_get_render_mode (display, &mode)) return FALSE; - g_value_init (value, GST_VAAPI_TYPE_RENDER_MODE); + if (!G_IS_VALUE (value)) + g_value_init (value, GST_VAAPI_TYPE_RENDER_MODE); g_value_set_enum (value, mode); break; } case VADisplayAttribRotation:{ GstVaapiRotation rotation; rotation = gst_vaapi_display_get_rotation (display); - g_value_init (value, GST_VAAPI_TYPE_ROTATION); + if (!G_IS_VALUE (value)) + g_value_init (value, GST_VAAPI_TYPE_ROTATION); g_value_set_enum (value, rotation); break; } @@ -1020,7 +1022,8 @@ _get_property (GstVaapiDisplay * display, const GstVaapiProperty * prop, gfloat val; if (!get_color_balance (display, find_property_id (prop->name), &val)) return FALSE; - g_value_init (value, G_TYPE_FLOAT); + if (!G_IS_VALUE (value)) + g_value_init (value, G_TYPE_FLOAT); g_value_set_float (value, val); break; }