mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
docs: tutorial 1: error out if an error occurred in Hello World tutorial
Very confusing if it just exits silently with exit code 0 on error. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1185>
This commit is contained in:
parent
064f7bbbfa
commit
3809b9dca4
1 changed files with 7 additions and 2 deletions
|
@ -25,9 +25,14 @@ main (int argc, char *argv[])
|
|||
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
||||
GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
|
||||
|
||||
/* See next tutorial for proper error message handling/parsing */
|
||||
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {
|
||||
g_error ("An error occurred! Re-run with the GST_DEBUG=*:WARN environment "
|
||||
"variable set for more details.");
|
||||
}
|
||||
|
||||
/* Free resources */
|
||||
if (msg != NULL)
|
||||
gst_message_unref (msg);
|
||||
gst_message_unref (msg);
|
||||
gst_object_unref (bus);
|
||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||
gst_object_unref (pipeline);
|
||||
|
|
Loading…
Reference in a new issue