diff --git a/gst/gstparse.c b/gst/gstparse.c index a23cafa5eb..75c6aa5c4d 100644 --- a/gst/gstparse.c +++ b/gst/gstparse.c @@ -314,6 +314,7 @@ gst_parse_launch_full (const gchar * pipeline_description, { #ifndef GST_DISABLE_PARSE GstElement *element; + GError *myerror = NULL; g_return_val_if_fail (pipeline_description != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); @@ -321,16 +322,20 @@ gst_parse_launch_full (const gchar * pipeline_description, GST_CAT_INFO (GST_CAT_PIPELINE, "parsing pipeline description '%s'", pipeline_description); - element = priv_gst_parse_launch (pipeline_description, error, context, flags); + element = priv_gst_parse_launch (pipeline_description, &myerror, context, + flags); /* don't return partially constructed pipeline if FATAL_ERRORS was given */ - if (G_UNLIKELY (error != NULL && *error != NULL && element != NULL)) { + if (G_UNLIKELY (myerror != NULL && element != NULL)) { if ((flags & GST_PARSE_FLAG_FATAL_ERRORS)) { gst_object_unref (element); element = NULL; } } + if (myerror) + g_propagate_error (error, myerror); + return element; #else gchar *msg; diff --git a/tests/check/pipelines/parse-launch.c b/tests/check/pipelines/parse-launch.c index 8db1d6b505..fe292dfcb4 100644 --- a/tests/check/pipelines/parse-launch.c +++ b/tests/check/pipelines/parse-launch.c @@ -651,6 +651,11 @@ GST_START_TEST (test_flags) fail_unless (element == NULL, "expected NULL return with FATAL_ERRORS"); g_error_free (err); err = NULL; + + /* test GST_PARSE_FLAG_FATAL_ERRORS without GError */ + element = gst_parse_launch_full ("fakesrc ! coffeesink", NULL, + GST_PARSE_FLAG_FATAL_ERRORS, NULL); + fail_unless (element == NULL, "expected NULL return with FATAL_ERRORS"); } GST_END_TEST;