From d7a4293774a2b248d83d82fe083870ab96ad0266 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 16 Nov 2009 22:05:16 +0200 Subject: [PATCH] lv2: only use g_return_val_if_fail for checking pre-conditions g_return_* can be disabled. Still we want to check for failed instance creation. --- ext/lv2/gstlv2.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ext/lv2/gstlv2.c b/ext/lv2/gstlv2.c index 99e5f5f61d..067d1c0aca 100644 --- a/ext/lv2/gstlv2.c +++ b/ext/lv2/gstlv2.c @@ -612,9 +612,9 @@ gst_lv2_setup (GstSignalProcessor * gsp, GstCaps * caps) GST_DEBUG_OBJECT (lv2, "instantiating the plugin at %d Hz", sample_rate); - lv2->instance = slv2_plugin_instantiate (oclass->plugin, sample_rate, NULL); - - g_return_val_if_fail (lv2->instance != NULL, FALSE); + if (!(lv2->instance = + slv2_plugin_instantiate (oclass->plugin, sample_rate, NULL))) + goto no_instance; /* connect the control ports */ for (i = 0; i < gsp_class->num_control_in; i++) @@ -633,6 +633,11 @@ no_sample_rate: GST_WARNING_OBJECT (gsp, "got no sample-rate"); return FALSE; } +no_instance: + { + GST_WARNING_OBJECT (gsp, "could not create instance"); + return FALSE; + } } static gboolean