From 06d79151c1aa45b4d6c7988ddc58a04993960e2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 8 May 2009 16:28:03 +0100 Subject: [PATCH] bin: fix debug message Make the debug message show what's actually happening (the message replaced here is not necessarily of the same type as the one that replaces it). --- gst/gstbin.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gst/gstbin.c b/gst/gstbin.c index 2be4480..6f67e5d 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -831,12 +831,16 @@ bin_replace_message (GstBin * bin, GstMessage * message, GstMessageType types) if ((src = GST_MESSAGE_SRC (message))) { /* first find the previous message posted by this element */ if ((previous = find_message (bin, src, types))) { + GstMessage *previous_msg; + /* if we found a previous message, replace it */ - gst_message_unref (previous->data); + previous_msg = previous->data; previous->data = message; - GST_DEBUG_OBJECT (bin, "replace old message %s from %s", - name, GST_ELEMENT_NAME (src)); + GST_DEBUG_OBJECT (bin, "replace old message %s from %s with %s message", + GST_MESSAGE_TYPE_NAME (previous_msg), GST_ELEMENT_NAME (src), name); + + gst_message_unref (previous_msg); } else { /* keep new message */ bin->messages = g_list_prepend (bin->messages, message); -- 2.7.4