Merge remote-tracking branch 'origin/master' into 0.11
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 27 Nov 2011 23:31:43 +0000 (23:31 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 27 Nov 2011 23:31:43 +0000 (23:31 +0000)
Conflicts:
gst/equalizer/gstiirequalizer.c

1  2 
gst/equalizer/gstiirequalizer.c

@@@ -817,20 -832,10 +817,13 @@@ gst_iir_equalizer_transform_ip (GstBase
    GstAudioFilter *filter = GST_AUDIO_FILTER (btrans);
    GstIirEqualizer *equ = GST_IIR_EQUALIZER (btrans);
    GstClockTime timestamp;
 +  guint8 *data;
 +  gsize size;
 +  gint channels = GST_AUDIO_FILTER_CHANNELS (filter);
  
 -  if (G_UNLIKELY (filter->format.channels < 1 || equ->process == NULL))
 +  if (G_UNLIKELY (channels < 1 || equ->process == NULL))
      return GST_FLOW_NOT_NEGOTIATED;
  
-   BANDS_LOCK (equ);
-   if (equ->need_new_coefficients) {
-     update_coefficients (equ);
-     set_passthrough (equ);
-   }
-   BANDS_UNLOCK (equ);
    if (gst_base_transform_is_passthrough (btrans))
      return GST_FLOW_OK;
  
    timestamp =
        gst_segment_to_stream_time (&btrans->segment, GST_FORMAT_TIME, timestamp);
  
-   if (GST_CLOCK_TIME_IS_VALID (timestamp))
+   if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
+     GstIirEqualizerBand **filters = equ->bands;
+     guint f, nf = equ->freq_band_count;
 -    gst_object_sync_values (G_OBJECT (equ), timestamp);
 +    gst_object_sync_values (GST_OBJECT (equ), timestamp);
+     /* sync values for bands too */
+     for (f = 0; f < nf; f++) {
 -      gst_object_sync_values (G_OBJECT (filters[f]), timestamp);
++      gst_object_sync_values (GST_OBJECT (filters[f]), timestamp);
+     }
+   }
+   BANDS_LOCK (equ);
+   if (equ->need_new_coefficients) {
+     update_coefficients (equ);
+     set_passthrough (equ);
+   }
+   BANDS_UNLOCK (equ);
  
 -  equ->process (equ, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf),
 -      filter->format.channels);
 +  data = gst_buffer_map (buf, &size, NULL, GST_MAP_WRITE);
 +  equ->process (equ, data, size, channels);
 +  gst_buffer_unmap (buf, data, size);
  
    return GST_FLOW_OK;
  }