aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/codec_adpcm.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-16 21:09:46 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-16 21:09:46 +0000
commitdbec3d56c146801fad339a1d46a388865b18ffb4 (patch)
tree8fda811f62cb6ffb99847befb7b74b1519ea95ba /codecs/codec_adpcm.c
parent0fb9c73a989207650aa3ba603824e4593809611b (diff)
Don't reload a configuration file if nothing has changed.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79747 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_adpcm.c')
-rw-r--r--codecs/codec_adpcm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/codecs/codec_adpcm.c b/codecs/codec_adpcm.c
index fb4bb8bd7..e76470b6c 100644
--- a/codecs/codec_adpcm.c
+++ b/codecs/codec_adpcm.c
@@ -350,11 +350,12 @@ static struct ast_translator lintoadpcm = {
.buf_size = BUFFER_SAMPLES/ 2, /* 2 samples per byte */
};
-static void parse_config(void)
+static void parse_config(int reload)
{
- struct ast_config *cfg = ast_config_load("codecs.conf");
+ struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
+ struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
struct ast_variable *var;
- if (cfg == NULL)
+ if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
return;
for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
@@ -368,7 +369,7 @@ static void parse_config(void)
/*! \brief standard module glue */
static int reload(void)
{
- parse_config();
+ parse_config(1);
return 0;
}
@@ -386,7 +387,7 @@ static int load_module(void)
{
int res;
- parse_config();
+ parse_config(0);
res = ast_register_translator(&adpcmtolin);
if (!res)
res = ast_register_translator(&lintoadpcm);