diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-05-13 17:42:17 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-05-13 17:42:17 +0000 |
commit | ea3fb96b29fe937b1e82a61ad03e77e8a50a62fd (patch) | |
tree | 30a7dd80f86d8a2a1565249bf10089e05453caa1 /funcs/func_speex.c | |
parent | dcbc0aab3f0ab632ac090729ec68550196298fa0 (diff) |
Re-introduce proper error handling that was removed in recent commits.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_speex.c')
-rw-r--r-- | funcs/func_speex.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/funcs/func_speex.c b/funcs/func_speex.c index f4d5fe412..fc4eb8e3e 100644 --- a/funcs/func_speex.c +++ b/funcs/func_speex.c @@ -336,12 +336,16 @@ static int unload_module(void) static int load_module(void) { - int res = 0; + if (ast_custom_function_register(&agc_function)) { + return AST_MODULE_LOAD_DECLINE; + } - res |= ast_custom_function_register(&agc_function); - res |= ast_custom_function_register(&denoise_function); + if (ast_custom_function_register(&denoise_function)) { + ast_custom_function_unregister(&agc_function); + return AST_MODULE_LOAD_DECLINE; + } - return res; + return AST_MODULE_LOAD_SUCCESS; } AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Noise reduction and Automatic Gain Control (AGC)"); |