From 03566e5002b3d34628b497c9bc2df9ddeec4c85c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 26 Jan 2016 16:56:57 +0100 Subject: [PATCH] audio-converter: add reset function --- gst-libs/gst/audio/audio-converter.c | 14 ++++++++++++++ gst-libs/gst/audio/audio-converter.h | 2 ++ win32/common/libgstaudio.def | 2 ++ 3 files changed, 18 insertions(+) diff --git a/gst-libs/gst/audio/audio-converter.c b/gst-libs/gst/audio/audio-converter.c index abd9070d7..079234503 100644 --- a/gst-libs/gst/audio/audio-converter.c +++ b/gst-libs/gst/audio/audio-converter.c @@ -972,6 +972,20 @@ gst_audio_converter_get_max_latency (GstAudioConverter * convert) return 0; } +/** + * gst_audio_converter_reset: + * @convert: a #GstAudioConverter + * + * Reset @convert to the state it was when it was first created, clearing + * any history it might currently have. + */ +void +gst_audio_converter_reset (GstAudioConverter * convert) +{ + if (convert->quant) + gst_audio_quantize_reset (convert->quant); +} + /** * gst_audio_converter_samples: * @convert: a #GstAudioConverter diff --git a/gst-libs/gst/audio/audio-converter.h b/gst-libs/gst/audio/audio-converter.h index 6251d2f8f..6d037db0d 100644 --- a/gst-libs/gst/audio/audio-converter.h +++ b/gst-libs/gst/audio/audio-converter.h @@ -79,6 +79,8 @@ GstAudioConverter * gst_audio_converter_new (GstAudioConverterFlags void gst_audio_converter_free (GstAudioConverter * convert); +void gst_audio_converter_reset (GstAudioConverter * convert); + gboolean gst_audio_converter_update_config (GstAudioConverter * convert, gint in_rate, gint out_rate, GstStructure *config); diff --git a/win32/common/libgstaudio.def b/win32/common/libgstaudio.def index 26914306f..d0b7f44cb 100644 --- a/win32/common/libgstaudio.def +++ b/win32/common/libgstaudio.def @@ -53,6 +53,7 @@ EXPORTS gst_audio_converter_get_max_latency gst_audio_converter_get_out_frames gst_audio_converter_new + gst_audio_converter_reset gst_audio_converter_samples gst_audio_converter_update_config gst_audio_decoder_allocate_output_buffer @@ -150,6 +151,7 @@ EXPORTS gst_audio_quantize_flags_get_type gst_audio_quantize_free gst_audio_quantize_new + gst_audio_quantize_reset gst_audio_quantize_samples gst_audio_reorder_channels gst_audio_ring_buffer_acquire -- 2.34.1