From 3809b9dca445490764b571c98a0a1f558f172f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 18 Oct 2021 18:20:10 +0100 Subject: [PATCH] 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: --- .../gst-docs/examples/tutorials/basic-tutorial-1.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c b/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c index dfd449b238..573d4b2e90 100644 --- a/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c +++ b/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c @@ -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);