From 5a6a6ae871b206a29942e54c7235945c9216138a Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 7 May 2022 04:43:49 +0900 Subject: [PATCH] tools: device-monitor: Print string property as-is without serialize gst_value_serialize() does more than what's needed to printf-ing especially when given GValue is already string. Just print string value as-is without gst_value_serialize() to avoid unreadable string print, especially for multi-bytes character encoding cases. Part-of: --- subprojects/gst-plugins-base/tools/gst-device-monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subprojects/gst-plugins-base/tools/gst-device-monitor.c b/subprojects/gst-plugins-base/tools/gst-device-monitor.c index 13ea0f4acc..c7d8557ee7 100644 --- a/subprojects/gst-plugins-base/tools/gst-device-monitor.c +++ b/subprojects/gst-plugins-base/tools/gst-device-monitor.c @@ -144,6 +144,8 @@ print_structure_field (GQuark field_id, const GValue * value, if (G_VALUE_HOLDS_UINT (value)) { val = g_strdup_printf ("%u (0x%08x)", g_value_get_uint (value), g_value_get_uint (value)); + } else if (G_VALUE_HOLDS_STRING (value)) { + val = g_value_dup_string (value); } else { val = gst_value_serialize (value); }