mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
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.
This commit is contained in:
parent
24457c8ec8
commit
fa5bad8ef9
2 changed files with 15 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2007-02-21 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
|
* 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 <wim@fluendo.com>
|
2007-02-21 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* docs/gst/gstreamer-sections.txt:
|
* docs/gst/gstreamer-sections.txt:
|
||||||
|
|
|
@ -433,16 +433,16 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
|
||||||
case GST_MESSAGE_WARNING:{
|
case GST_MESSAGE_WARNING:{
|
||||||
GError *gerror;
|
GError *gerror;
|
||||||
gchar *debug;
|
gchar *debug;
|
||||||
|
gchar *name = gst_object_get_path_string (GST_MESSAGE_SRC (message));
|
||||||
|
|
||||||
gst_message_parse_warning (message, &gerror, &debug);
|
gst_message_parse_warning (message, &gerror, &debug);
|
||||||
|
g_print (_("WARNING: from element %s: %s\n"), name, gerror->message);
|
||||||
if (debug) {
|
if (debug) {
|
||||||
g_print ("WARNING: Element \"%s\" warns: %s\n",
|
g_print (_("Additional debug info:\n%s\n"), debug);
|
||||||
GST_STR_NULL (GST_ELEMENT_NAME (GST_MESSAGE_SRC (message))),
|
|
||||||
debug);
|
|
||||||
}
|
}
|
||||||
if (gerror)
|
g_error_free (gerror);
|
||||||
g_error_free (gerror);
|
|
||||||
g_free (debug);
|
g_free (debug);
|
||||||
|
g_free (name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_MESSAGE_ERROR:{
|
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_message_parse_error (message, &gerror, &debug);
|
||||||
gst_object_default_error (GST_MESSAGE_SRC (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);
|
g_free (debug);
|
||||||
/* we have an error */
|
/* we have an error */
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue