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.
This commit is contained in:
parent
d7a4293774
commit
a9ffdb5b47
@ -578,9 +578,8 @@ gst_ladspa_setup (GstSignalProcessor * gsp, GstCaps * caps)
|
|||||||
|
|
||||||
GST_DEBUG_OBJECT (ladspa, "instantiating the plugin at %d Hz", sample_rate);
|
GST_DEBUG_OBJECT (ladspa, "instantiating the plugin at %d Hz", sample_rate);
|
||||||
|
|
||||||
ladspa->handle = desc->instantiate (desc, sample_rate);
|
if (!(ladspa->handle = desc->instantiate (desc, sample_rate)))
|
||||||
|
goto no_instance;
|
||||||
g_return_val_if_fail (ladspa->handle != NULL, FALSE);
|
|
||||||
|
|
||||||
/* connect the control ports */
|
/* connect the control ports */
|
||||||
for (i = 0; i < gsp_class->num_control_in; i++)
|
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");
|
GST_WARNING_OBJECT (gsp, "got no sample-rate");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
no_instance:
|
||||||
|
{
|
||||||
|
GST_WARNING_OBJECT (gsp, "could not create instance");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user