From 6db0939b96017b468d2d368e67669fd02b2fdecc Mon Sep 17 00:00:00 2001 From: George Joseph Date: Wed, 12 Apr 2017 06:47:59 -0600 Subject: modules: change module LOAD_FAILUREs to LOAD_DECLINES (14) Change-Id: If99e3b4fc2d7e86fc3e61182aa6c835b407ed49e --- formats/format_ogg_speex.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'formats') diff --git a/formats/format_ogg_speex.c b/formats/format_ogg_speex.c index 747adb37f..331c54435 100644 --- a/formats/format_ogg_speex.c +++ b/formats/format_ogg_speex.c @@ -312,6 +312,15 @@ static struct ast_format_def speex32_f = { .desc_size = sizeof(struct speex_desc), }; +static int unload_module(void) +{ + int res = 0; + res |= ast_format_def_unregister(speex_f.name); + res |= ast_format_def_unregister(speex16_f.name); + res |= ast_format_def_unregister(speex32_f.name); + return res; +} + static int load_module(void) { speex_f.format = ast_format_speex; @@ -321,21 +330,13 @@ static int load_module(void) if (ast_format_def_register(&speex_f) || ast_format_def_register(&speex16_f) || ast_format_def_register(&speex32_f)) { - return AST_MODULE_LOAD_FAILURE; + unload_module(); + return AST_MODULE_LOAD_DECLINE; } return AST_MODULE_LOAD_SUCCESS; } -static int unload_module(void) -{ - int res = 0; - res |= ast_format_def_unregister(speex_f.name); - res |= ast_format_def_unregister(speex16_f.name); - res |= ast_format_def_unregister(speex32_f.name); - return res; -} - AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "OGG/Speex audio", .load = load_module, .unload = unload_module, -- cgit v1.2.3