docs: basic-tutotial-1: Don't crash on error

Using g_error() crashes the application, producing a coredump e.g. when
the user closes the video window, which can be confusing (especially on
the very first tutorial).

Let's change this to log the error message without crashing, using
g_printerr(), like subsequent tutorials.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6883>
This commit is contained in:
Fotis Xenakis 2024-05-18 17:42:30 +02:00
parent b7357fd316
commit 85fa81c7c8

View file

@ -31,8 +31,8 @@ tutorial_main (int argc, char *argv[])
/* 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.");
g_printerr ("An error occurred! Re-run with the GST_DEBUG=*:WARN "
"environment variable set for more details.\n");
}
/* Free resources */