[vlc-commits] uleaddvaudio: use vlc_obj_malloc() and simplify
Rémi Denis-Courmont
git at videolan.org
Fri Sep 25 15:53:58 CEST 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Sep 25 16:45:02 2020 +0300| [e33c290b36af06dd587bf64ac659b1fd820535cf] | committer: Rémi Denis-Courmont
uleaddvaudio: use vlc_obj_malloc() and simplify
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e33c290b36af06dd587bf64ac659b1fd820535cf
---
modules/codec/uleaddvaudio.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/modules/codec/uleaddvaudio.c b/modules/codec/uleaddvaudio.c
index 4d80908703..5b91c2e972 100644
--- a/modules/codec/uleaddvaudio.c
+++ b/modules/codec/uleaddvaudio.c
@@ -34,14 +34,13 @@
* Module descriptor
*****************************************************************************/
static int Open(vlc_object_t *);
-static void Close(vlc_object_t *);
vlc_module_begin()
set_description(N_("Ulead DV audio decoder"))
set_capability("audio decoder", 50)
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_ACODEC)
- set_callbacks(Open, Close)
+ set_callback(Open)
vlc_module_end()
typedef struct
@@ -146,7 +145,7 @@ static int Open(vlc_object_t *object)
if (dec->fmt_in.audio.i_rate <= 0)
return VLC_EGENERIC;
- decoder_sys_t *sys = dec->p_sys = malloc(sizeof(*sys));
+ decoder_sys_t *sys = dec->p_sys = vlc_obj_malloc(object, sizeof(*sys));
if (!sys)
return VLC_ENOMEM;
@@ -172,11 +171,3 @@ static int Open(vlc_object_t *object)
return VLC_SUCCESS;
}
-
-static void Close(vlc_object_t *object)
-{
- decoder_t *dec = (decoder_t *)object;
-
- free(dec->p_sys);
-}
-
More information about the vlc-commits
mailing list