From: Thomas Vander Stichele Date: Wed, 21 Feb 2007 15:30:53 +0000 (+0000) Subject: tools/gst-launch.c: Make sure that we actually show the important message part of... X-Git-Tag: RELEASE-0_10_12~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa5bad8ef9ba72694f6d51960ae1ad7fa51141ee;p=platform%2Fupstream%2Fgstreamer.git tools/gst-launch.c: Make sure that we actually show the important message part of a warning message. Original commit message from CVS: * tools/gst-launch.c: (event_loop): Make sure that we actually show the important message part of a warning message. No need to check if the gerror is not NULL to free; first of all g_free accepts NULL; and second the default error handler would segfault if gerror was NULL. --- diff --git a/ChangeLog b/ChangeLog index efa7cef..ac471af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-02-21 Thomas Vander Stichele + + * tools/gst-launch.c: (event_loop): + Make sure that we actually show the important message part of a + warning message. + No need to check if the gerror is not NULL to free; first of all + g_free accepts NULL; and second the default error handler would + segfault if gerror was NULL. + 2007-02-21 Wim Taymans * docs/gst/gstreamer-sections.txt: diff --git a/tools/gst-launch.c b/tools/gst-launch.c index d4a7cbf..4f9f6b1 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -433,16 +433,16 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state) case GST_MESSAGE_WARNING:{ GError *gerror; gchar *debug; + gchar *name = gst_object_get_path_string (GST_MESSAGE_SRC (message)); gst_message_parse_warning (message, &gerror, &debug); + g_print (_("WARNING: from element %s: %s\n"), name, gerror->message); if (debug) { - g_print ("WARNING: Element \"%s\" warns: %s\n", - GST_STR_NULL (GST_ELEMENT_NAME (GST_MESSAGE_SRC (message))), - debug); + g_print (_("Additional debug info:\n%s\n"), debug); } - if (gerror) - g_error_free (gerror); + g_error_free (gerror); g_free (debug); + g_free (name); break; } case GST_MESSAGE_ERROR:{ @@ -451,8 +451,7 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state) gst_message_parse_error (message, &gerror, &debug); gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug); - if (gerror) - g_error_free (gerror); + g_error_free (gerror); g_free (debug); /* we have an error */ res = TRUE;