summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-01-26 18:39:45 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-01-26 18:39:45 +0000
commit25271218deca0f45ca8228c876b1ae22a5d77970 (patch)
treec46d697772b6bda0abb41a448c5ab3d1f6bbc087
parentfbdf4dcedad8692f1e3d8838551188987e462e74 (diff)
tests: fix warning in rtpool-test
The stream status message object may be of a non-GObject type, e.g. G_TYPE_POINTER (see GstAudioSrc), so print that properly instead of assuming the value holds an object.
-rw-r--r--tests/examples/streams/rtpool-test.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/examples/streams/rtpool-test.c b/tests/examples/streams/rtpool-test.c
index 49e29ebcb0..d612f06213 100644
--- a/tests/examples/streams/rtpool-test.c
+++ b/tests/examples/streams/rtpool-test.c
@@ -74,8 +74,16 @@ sync_bus_handler (GstBus * bus, GstMessage * message, GstElement * bin)
path = gst_object_get_path_string (GST_OBJECT (owner));
g_message ("owner: %s", path);
g_free (path);
- g_message ("object: type %s, value %p", G_VALUE_TYPE_NAME (val),
- g_value_get_object (val));
+
+ if (G_VALUE_HOLDS_OBJECT (val)) {
+ g_message ("object: type %s, value %p", G_VALUE_TYPE_NAME (val),
+ g_value_get_object (val));
+ } else if (G_VALUE_HOLDS_POINTER (val)) {
+ g_message ("object: type %s, value %p", G_VALUE_TYPE_NAME (val),
+ g_value_get_pointer (val));
+ } else {
+ g_message ("object: type %s", G_VALUE_TYPE_NAME (val));
+ }
/* see if we know how to deal with this object */
if (G_VALUE_TYPE (val) == GST_TYPE_TASK) {