diff options
author | Joshua Colp <jcolp@digium.com> | 2017-04-13 07:06:51 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-04-13 07:06:51 -0500 |
commit | 49535c17fc6feefb1533e5460d9bde5815178647 (patch) | |
tree | cb5cc5c67939909a5780ec6b161609e278fb409c /formats | |
parent | e803eafb653b6eb4206d57575cdad2a25a32b4fe (diff) | |
parent | 6db0939b96017b468d2d368e67669fd02b2fdecc (diff) |
Merge "modules: change module LOAD_FAILUREs to LOAD_DECLINES (14)"
Diffstat (limited to 'formats')
-rw-r--r-- | formats/format_ogg_speex.c | 21 |
1 files changed, 11 insertions, 10 deletions
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, |