audio-quantize: add _reset function
authorWim Taymans <wtaymans@redhat.com>
Tue, 26 Jan 2016 15:34:35 +0000 (16:34 +0100)
committerWim Taymans <wtaymans@redhat.com>
Tue, 26 Jan 2016 15:45:44 +0000 (16:45 +0100)
Add a reset function that clears any history.

gst-libs/gst/audio/audio-quantize.c
gst-libs/gst/audio/audio-quantize.h

index 6f5a4a5..b09ee04 100644 (file)
@@ -484,6 +484,21 @@ gst_audio_quantize_free (GstAudioQuantize * quant)
 }
 
 /**
+ * gst_audio_quantize_reset:
+ * @quant: a #GstAudioQuantize
+ *
+ * Reset @quant to the state is was when created, clearing any
+ * history it might have.
+ */
+void
+gst_audio_quantize_reset (GstAudioQuantize * quant)
+{
+  g_free (quant->error_buf);
+  quant->error_buf = NULL;
+  quant->error_size = 0;
+}
+
+/**
  * gst_audio_quantize_samples:
  * @quant: a #GstAudioQuantize
  * @in: input samples
index 0c70237..e60c516 100644 (file)
@@ -90,6 +90,8 @@ GstAudioQuantize *  gst_audio_quantize_new      (GstAudioDitherMethod dither,
 
 void                gst_audio_quantize_free     (GstAudioQuantize * quant);
 
+void                gst_audio_quantize_reset    (GstAudioQuantize * quant);
+
 void                gst_audio_quantize_samples  (GstAudioQuantize * quant,
                                                  const gpointer in[],
                                                  gpointer out[], guint samples);