mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +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,8 +25,13 @@ main (int argc, char *argv[])
|
||||||
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
||||||
GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
|
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 */
|
/* Free resources */
|
||||||
if (msg != NULL)
|
|
||||||
gst_message_unref (msg);
|
gst_message_unref (msg);
|
||||||
gst_object_unref (bus);
|
gst_object_unref (bus);
|
||||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||||
|
|
Loading…
Reference in a new issue