mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
audioiirfilter: Don't crash if no filter coefficients are provided
...and by default use a identity filter. https://bugzilla.gnome.org/show_bug.cgi?id=710215
This commit is contained in:
parent
4f288a5234
commit
2559557ff1
2 changed files with 7 additions and 4 deletions
|
@ -372,7 +372,11 @@ gst_audio_fx_base_iir_filter_transform_ip (GstBaseTransform * base,
|
|||
if (GST_CLOCK_TIME_IS_VALID (stream_time))
|
||||
gst_object_sync_values (GST_OBJECT (filter), stream_time);
|
||||
|
||||
g_return_val_if_fail (filter->a != NULL, GST_FLOW_ERROR);
|
||||
if (filter->a == NULL || filter->b == NULL) {
|
||||
g_return_val_if_fail (filter->a != NULL
|
||||
&& filter->b != NULL, GST_FLOW_ERROR);
|
||||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
|
||||
num_samples = map.size / GST_AUDIO_FILTER_BPS (filter);
|
||||
|
|
|
@ -186,7 +186,7 @@ static void
|
|||
gst_audio_iir_filter_init (GstAudioIIRFilter * self)
|
||||
{
|
||||
GValue v = { 0, };
|
||||
GValueArray *a, *b;
|
||||
GValueArray *a;
|
||||
|
||||
a = g_value_array_new (1);
|
||||
|
||||
|
@ -195,8 +195,7 @@ gst_audio_iir_filter_init (GstAudioIIRFilter * self)
|
|||
g_value_array_append (a, &v);
|
||||
g_value_unset (&v);
|
||||
|
||||
b = NULL;
|
||||
gst_audio_iir_filter_update_coefficients (self, a, b);
|
||||
gst_audio_iir_filter_update_coefficients (self, a, a);
|
||||
|
||||
g_mutex_init (&self->lock);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue