good: use of g_value_dup_string

Use helper method to get string from GValue.
This commit is contained in:
Stéphane Cerveau 2019-12-18 16:07:18 +01:00 committed by GStreamer Merge Bot
parent 8b96d8ee8d
commit b928517f1e
3 changed files with 11 additions and 11 deletions

View file

@ -803,44 +803,44 @@ gst_shout2send_set_property (GObject * object, guint prop_id,
case ARG_IP: case ARG_IP:
g_free (shout2send->ip); g_free (shout2send->ip);
shout2send->ip = g_strdup (g_value_get_string (value)); shout2send->ip = g_value_dup_string (value);
break; break;
case ARG_PORT: case ARG_PORT:
shout2send->port = g_value_get_int (value); shout2send->port = g_value_get_int (value);
break; break;
case ARG_PASSWORD: case ARG_PASSWORD:
g_free (shout2send->password); g_free (shout2send->password);
shout2send->password = g_strdup (g_value_get_string (value)); shout2send->password = g_value_dup_string (value);
break; break;
case ARG_USERNAME: case ARG_USERNAME:
g_free (shout2send->username); g_free (shout2send->username);
shout2send->username = g_strdup (g_value_get_string (value)); shout2send->username = g_value_dup_string (value);
break; break;
case ARG_PUBLIC: case ARG_PUBLIC:
shout2send->ispublic = g_value_get_boolean (value); shout2send->ispublic = g_value_get_boolean (value);
break; break;
case ARG_STREAMNAME: /* Name of the stream */ case ARG_STREAMNAME: /* Name of the stream */
g_free (shout2send->streamname); g_free (shout2send->streamname);
shout2send->streamname = g_strdup (g_value_get_string (value)); shout2send->streamname = g_value_dup_string (value);
break; break;
case ARG_DESCRIPTION: /* Description of the stream */ case ARG_DESCRIPTION: /* Description of the stream */
g_free (shout2send->description); g_free (shout2send->description);
shout2send->description = g_strdup (g_value_get_string (value)); shout2send->description = g_value_dup_string (value);
break; break;
case ARG_GENRE: /* Genre of the stream */ case ARG_GENRE: /* Genre of the stream */
g_free (shout2send->genre); g_free (shout2send->genre);
shout2send->genre = g_strdup (g_value_get_string (value)); shout2send->genre = g_value_dup_string (value);
break; break;
case ARG_PROTOCOL: /* protocol to connect with */ case ARG_PROTOCOL: /* protocol to connect with */
shout2send->protocol = g_value_get_enum (value); shout2send->protocol = g_value_get_enum (value);
break; break;
case ARG_MOUNT: /* mountpoint of stream (icecast only) */ case ARG_MOUNT: /* mountpoint of stream (icecast only) */
g_free (shout2send->mount); g_free (shout2send->mount);
shout2send->mount = g_strdup (g_value_get_string (value)); shout2send->mount = g_value_dup_string (value);
break; break;
case ARG_URL: /* the stream's homepage URL */ case ARG_URL: /* the stream's homepage URL */
g_free (shout2send->url); g_free (shout2send->url);
shout2send->url = g_strdup (g_value_get_string (value)); shout2send->url = g_value_dup_string (value);
break; break;
case ARG_TIMEOUT: case ARG_TIMEOUT:
shout2send->timeout = g_value_get_uint (value); shout2send->timeout = g_value_get_uint (value);

View file

@ -639,7 +639,7 @@ gst_multipart_mux_set_property (GObject * object,
switch (prop_id) { switch (prop_id) {
case PROP_BOUNDARY: case PROP_BOUNDARY:
g_free (mux->boundary); g_free (mux->boundary);
mux->boundary = g_strdup (g_value_get_string (value)); mux->boundary = g_value_dup_string (value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);

View file

@ -929,7 +929,7 @@ gst_ximage_src_set_property (GObject * object, guint prop_id,
case PROP_DISPLAY_NAME: case PROP_DISPLAY_NAME:
g_free (src->display_name); g_free (src->display_name);
src->display_name = g_strdup (g_value_get_string (value)); src->display_name = g_value_dup_string (value);
break; break;
case PROP_SHOW_POINTER: case PROP_SHOW_POINTER:
src->show_pointer = g_value_get_boolean (value); src->show_pointer = g_value_get_boolean (value);
@ -965,7 +965,7 @@ gst_ximage_src_set_property (GObject * object, guint prop_id,
break; break;
} }
g_free (src->xname); g_free (src->xname);
src->xname = g_strdup (g_value_get_string (value)); src->xname = g_value_dup_string (value);
break; break;
default: default:
break; break;