diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-11-16 22:07:31 +0200 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-11-19 21:11:36 +0200 |
commit | a9ffdb5b47ff5801c5e91dff80f62c539e0581f7 (patch) | |
tree | dc0c34f3862ba7960a9ca65c3966f22a04c1ebc9 | |
parent | d7a4293774a2b248d83d82fe083870ab96ad0266 (diff) |
ladspa: 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.
-rw-r--r-- | ext/ladspa/gstladspa.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c index 75144986b..4b9b5b1ec 100644 --- a/ext/ladspa/gstladspa.c +++ b/ext/ladspa/gstladspa.c @@ -578,9 +578,8 @@ gst_ladspa_setup (GstSignalProcessor * gsp, GstCaps * caps) GST_DEBUG_OBJECT (ladspa, "instantiating the plugin at %d Hz", sample_rate); - ladspa->handle = desc->instantiate (desc, sample_rate); - - g_return_val_if_fail (ladspa->handle != NULL, FALSE); + if (!(ladspa->handle = desc->instantiate (desc, sample_rate))) + goto no_instance; /* connect the control ports */ for (i = 0; i < gsp_class->num_control_in; i++) @@ -597,6 +596,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 |