gst: convert properties to strings when we can

This commit is contained in:
Wim Taymans 2020-08-06 15:10:44 +02:00
parent e71936f870
commit b9862868c1
2 changed files with 20 additions and 8 deletions

View file

@ -1039,11 +1039,17 @@ copy_properties (GQuark field_id,
gpointer user_data)
{
struct pw_properties *properties = user_data;
GValue dst = { 0 };
if (G_VALUE_HOLDS_STRING (value))
pw_properties_set (properties,
g_quark_to_string (field_id),
g_value_get_string (value));
if (g_value_type_transformable (G_VALUE_TYPE(value), G_TYPE_STRING)) {
g_value_init(&dst, G_TYPE_STRING);
if (g_value_transform(value, &dst)) {
pw_properties_set (properties,
g_quark_to_string (field_id),
g_value_get_string (&dst));
}
g_value_unset(&dst);
}
return TRUE;
}