diff options
-rw-r--r-- | gst/audioparsers/gstmpegaudioparse.c | 4 | ||||
-rw-r--r-- | gst/equalizer/gstiirequalizer.c | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gst/audioparsers/gstmpegaudioparse.c b/gst/audioparsers/gstmpegaudioparse.c index 1cc9f64e2..7566c03d3 100644 --- a/gst/audioparsers/gstmpegaudioparse.c +++ b/gst/audioparsers/gstmpegaudioparse.c @@ -855,9 +855,7 @@ gst_mpeg_audio_parse_handle_first_frame (GstMpegAudioParse * mp3parse, GST_DEBUG_OBJECT (mp3parse, "Encoder delay %u, encoder padding %u", encoder_delay, encoder_padding); } - } - - if (read_id_vbri == vbri_id) { + } else if (read_id_vbri == vbri_id) { gint64 total_bytes, total_frames; GstClockTime total_time; guint16 nseek_points; diff --git a/gst/equalizer/gstiirequalizer.c b/gst/equalizer/gstiirequalizer.c index be903066a..ac20f352d 100644 --- a/gst/equalizer/gstiirequalizer.c +++ b/gst/equalizer/gstiirequalizer.c @@ -822,11 +822,16 @@ gst_iir_equalizer_transform_ip (GstBaseTransform * btrans, GstBuffer * buf) GstClockTime timestamp; GstMapInfo map; gint channels = GST_AUDIO_FILTER_CHANNELS (filter); + gboolean need_new_coefficients; if (G_UNLIKELY (channels < 1 || equ->process == NULL)) return GST_FLOW_NOT_NEGOTIATED; - if (gst_base_transform_is_passthrough (btrans)) + BANDS_LOCK (equ); + need_new_coefficients = equ->need_new_coefficients; + BANDS_UNLOCK (equ); + + if (!need_new_coefficients && gst_base_transform_is_passthrough (btrans)) return GST_FLOW_OK; timestamp = GST_BUFFER_TIMESTAMP (buf); @@ -838,14 +843,16 @@ gst_iir_equalizer_transform_ip (GstBaseTransform * btrans, GstBuffer * buf) guint f, nf = equ->freq_band_count; gst_object_sync_values (GST_OBJECT (equ), timestamp); + /* sync values for bands too */ + /* FIXME: iterating equ->bands is not thread-safe here */ for (f = 0; f < nf; f++) { gst_object_sync_values (GST_OBJECT (filters[f]), timestamp); } } BANDS_LOCK (equ); - if (equ->need_new_coefficients) { + if (need_new_coefficients) { update_coefficients (equ); set_passthrough (equ); } |