summaryrefslogtreecommitdiff
path: root/tools/gst-discoverer.c
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2011-01-06 08:47:04 +0100
committerEdward Hervey <bilboed@bilboed.com>2011-01-06 08:48:04 +0100
commitfce99dc0be15fca80e6d1e1fd447e3e1338f4e31 (patch)
treedaf2f750785fc3779ea00f947226e657488be9ce /tools/gst-discoverer.c
parentb40c0b875cbddf30c0c318350cae59f6cad6dfc7 (diff)
downloadgstreamer-plugins-base-fce99dc0be15fca80e6d1e1fd447e3e1338f4e31.tar.gz
tools: Improve pretty-printing of tags
Avoids escaping strings for nothing and printing out useless buffer contents.
Diffstat (limited to 'tools/gst-discoverer.c')
-rw-r--r--tools/gst-discoverer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/gst-discoverer.c b/tools/gst-discoverer.c
index 6a18f407b..c68721b1b 100644
--- a/tools/gst-discoverer.c
+++ b/tools/gst-discoverer.c
@@ -243,7 +243,13 @@ print_tag_each (GQuark field_id, const GValue * value, gpointer user_data)
gint tab = GPOINTER_TO_INT (user_data);
gchar *ser;
- ser = gst_value_serialize (value);
+ if (G_VALUE_HOLDS_STRING (value))
+ ser = g_value_dup_string (value);
+ else if (GST_VALUE_HOLDS_BUFFER (value)) {
+ GstBuffer *buf = gst_value_get_buffer (value);
+ ser = g_strdup_printf ("<GstBuffer [%d bytes]>", GST_BUFFER_SIZE (buf));
+ } else
+ ser = gst_value_serialize (value);
g_print ("%*s%s: %s\n", tab, " ",
gst_tag_get_nick (g_quark_to_string (field_id)), ser);