mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +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))
|
if (GST_CLOCK_TIME_IS_VALID (stream_time))
|
||||||
gst_object_sync_values (GST_OBJECT (filter), 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);
|
gst_buffer_map (buf, &map, GST_MAP_READWRITE);
|
||||||
num_samples = map.size / GST_AUDIO_FILTER_BPS (filter);
|
num_samples = map.size / GST_AUDIO_FILTER_BPS (filter);
|
||||||
|
|
|
@ -186,7 +186,7 @@ static void
|
||||||
gst_audio_iir_filter_init (GstAudioIIRFilter * self)
|
gst_audio_iir_filter_init (GstAudioIIRFilter * self)
|
||||||
{
|
{
|
||||||
GValue v = { 0, };
|
GValue v = { 0, };
|
||||||
GValueArray *a, *b;
|
GValueArray *a;
|
||||||
|
|
||||||
a = g_value_array_new (1);
|
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_array_append (a, &v);
|
||||||
g_value_unset (&v);
|
g_value_unset (&v);
|
||||||
|
|
||||||
b = NULL;
|
gst_audio_iir_filter_update_coefficients (self, a, a);
|
||||||
gst_audio_iir_filter_update_coefficients (self, a, b);
|
|
||||||
|
|
||||||
g_mutex_init (&self->lock);
|
g_mutex_init (&self->lock);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue