From cde091ae81d85e2ba677076a1afd2c1c73135948 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 26 Jan 2016 16:34:35 +0100 Subject: [PATCH] audio-quantize: add _reset function Add a reset function that clears any history. --- gst-libs/gst/audio/audio-quantize.c | 15 +++++++++++++++ gst-libs/gst/audio/audio-quantize.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/gst-libs/gst/audio/audio-quantize.c b/gst-libs/gst/audio/audio-quantize.c index 6f5a4a5d18..b09ee04027 100644 --- a/gst-libs/gst/audio/audio-quantize.c +++ b/gst-libs/gst/audio/audio-quantize.c @@ -483,6 +483,21 @@ gst_audio_quantize_free (GstAudioQuantize * quant) g_slice_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 diff --git a/gst-libs/gst/audio/audio-quantize.h b/gst-libs/gst/audio/audio-quantize.h index 0c70237f26..e60c51682c 100644 --- a/gst-libs/gst/audio/audio-quantize.h +++ b/gst-libs/gst/audio/audio-quantize.h @@ -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);