diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-31 19:24:29 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-31 19:24:29 +0000 |
commit | 9e15a0e72bccc9f21dd009b1c8a6375f07420473 (patch) | |
tree | daa3437ec6e548a5cc02c05654c1b9993bfd0eef /codecs/codec_speex.c | |
parent | d15b80b30e54c603f892bbeaa090ed27708674db (diff) |
More changes to change return values from load_module functions.
(issue #11096)
Patches:
codec_adpcm.c.patch uploaded by moy (license 222)
codec_alaw.c.patch uploaded by moy (license 222)
codec_a_mu.c.patch uploaded by moy (license 222)
codec_g722.c.patch uploaded by moy (license 222)
codec_g726.c.diff uploaded by moy (license 222)
codec_gsm.c.patch uploaded by moy (license 222)
codec_ilbc.c.patch uploaded by moy (license 222)
codec_lpc10.c.patch uploaded by moy (license 222)
codec_speex.c.patch uploaded by moy (license 222)
codec_ulaw.c.patch uploaded by moy (license 222)
codec_zap.c.patch uploaded by moy (license 222)
format_g723.c.patch uploaded by moy (license 222)
format_g726.c.patch uploaded by moy (license 222)
format_g729.c.patch uploaded by moy (license 222)
format_gsm.c.patch uploaded by moy (license 222)
format_h263.c.patch uploaded by moy (license 222)
format_h264.c.patch uploaded by moy (license 222)
format_ilbc.c.patch uploaded by moy (license 222)
format_jpeg.c.patch uploaded by moy (license 222)
format_ogg_vorbis.c.patch uploaded by moy (license 222)
format_pcm.c.patch uploaded by moy (license 222)
format_sln.c.patch uploaded by moy (license 222)
format_vox.c.patch uploaded by moy (license 222)
format_wav.c.patch uploaded by moy (license 222)
format_wav_gsm.c.patch uploaded by moy (license 222)
res_adsi.c.patch uploaded by eliel (license 64)
res_ael_share.c.patch uploaded by eliel (license 64)
res_clioriginate.c.patch uploaded by eliel (license 64)
res_convert.c.patch uploaded by eliel (license 64)
res_indications.c.patch uploaded by eliel (license 64)
res_musiconhold.c.patch uploaded by eliel (license 64)
res_smdi.c.patch uploaded by eliel (license 64)
res_speech.c.patch uploaded by eliel (license 64)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87889 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_speex.c')
-rw-r--r-- | codecs/codec_speex.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/codecs/codec_speex.c b/codecs/codec_speex.c index c4e24f915..bbb6be238 100644 --- a/codecs/codec_speex.c +++ b/codecs/codec_speex.c @@ -375,7 +375,7 @@ static struct ast_translator lintospeex = { .buf_size = BUFFER_SAMPLES * 2, /* XXX maybe a lot less ? */ }; -static void parse_config(int reload) +static int parse_config(int reload) { struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 }; struct ast_config *cfg = ast_config_load("codecs.conf", config_flags); @@ -384,7 +384,9 @@ static void parse_config(int reload) float res_f; if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED) - return; + return -1; + if (cfg == CONFIG_STATUS_FILEUNCHANGED) + return 0; for (var = ast_variable_browse(cfg, "speex"); var; var = var->next) { if (!strcasecmp(var->name, "quality")) { @@ -467,13 +469,14 @@ static void parse_config(int reload) } } ast_config_destroy(cfg); + return 0; } static int reload(void) { - parse_config(1); - - return 0; + if (parse_config(1)) + return AST_MODULE_LOAD_DECLINE; + return AST_MODULE_LOAD_SUCCESS; } static int unload_module(void) @@ -490,14 +493,16 @@ static int load_module(void) { int res; - parse_config(0); + if (parse_config(0)) + return AST_MODULE_LOAD_DECLINE; res=ast_register_translator(&speextolin); if (!res) res=ast_register_translator(&lintospeex); else ast_unregister_translator(&speextolin); - - return res; + if (res) + return AST_MODULE_LOAD_FAILURE; + return AST_MODULE_LOAD_SUCCESS; } AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Speex Coder/Decoder", |