[vlc-devel] [PATCH v2 26/26] audio meter: use a typed close callback in the operations structure
Steve Lhomme
robux4 at ycbcr.xyz
Fri Oct 9 15:04:22 CEST 2020
---
modules/audio_filter/libebur128.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/modules/audio_filter/libebur128.c b/modules/audio_filter/libebur128.c
index 368016eb7b6..a47c533c2c8 100644
--- a/modules/audio_filter/libebur128.c
+++ b/modules/audio_filter/libebur128.c
@@ -230,8 +230,18 @@ Flush(filter_t *filter)
}
}
+static void
+Close(filter_t *filter)
+{
+ struct filter_sys *sys = filter->p_sys;
+
+ if (sys->state != NULL)
+ ebur128_destroy(&sys->state);
+ free(filter->p_sys);
+}
+
static const struct vlc_filter_operations filter_ops = {
- .filter_audio = Process, .flush = Flush,
+ .filter_audio = Process, .flush = Flush, .close = Close,
};
static int Open(vlc_object_t *this)
@@ -287,17 +297,6 @@ static int Open(vlc_object_t *this)
return VLC_SUCCESS;
}
-static void
-Close(vlc_object_t *this)
-{
- filter_t *filter = (filter_t*) this;
- struct filter_sys *sys = filter->p_sys;
-
- if (sys->state != NULL)
- ebur128_destroy(&sys->state);
- free(filter->p_sys);
-}
-
vlc_module_begin()
set_shortname("EBU R 128")
set_description("EBU R128 standard for loudness normalisation")
@@ -305,5 +304,5 @@ vlc_module_begin()
set_subcategory(SUBCAT_AUDIO_AFILTER)
add_integer_with_range(CFG_PREFIX "mode", 0, 0, 4, N_("Mode"), NULL, false)
set_capability("audio meter", 0)
- set_callbacks(Open, Close)
+ set_callback(Open)
vlc_module_end()
--
2.26.2
More information about the vlc-devel
mailing list