Merged revisions 267492 via svnmerge from

https://origsvn.digium.com/svn/asterisk/trunk

........
  r267492 | mmichelson | 2010-06-03 12:09:11 -0500 (Thu, 03 Jun 2010) | 6 lines
  
  Remove unnecessary code relating to PLC.
  
  The logic for handling generic PLC is now handled in ast_write in
  channel.c instead of in translation code.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@267507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2010-06-03 17:21:06 +00:00
parent f82a5c2852
commit efe0f4231e
10 changed files with 8 additions and 258 deletions

View File

@@ -79,7 +79,6 @@ static struct ast_translator alawtolin = {
.sample = alaw_sample,
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
.plc_samples = 160,
};
static struct ast_translator lintoalaw = {
@@ -92,29 +91,10 @@ static struct ast_translator lintoalaw = {
.buf_size = BUFFER_SAMPLES,
};
static int parse_config(int reload)
{
struct ast_variable *var;
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
if (cfg == CONFIG_STATUS_FILEMISSING || cfg == CONFIG_STATUS_FILEUNCHANGED || cfg == CONFIG_STATUS_FILEINVALID)
return 0;
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
alawtolin.useplc = ast_true(var->value) ? 1 : 0;
ast_verb(3, "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
}
}
ast_config_destroy(cfg);
return 0;
}
/*! \brief standard module stuff */
static int reload(void)
{
if (parse_config(1))
return AST_MODULE_LOAD_DECLINE;
return AST_MODULE_LOAD_SUCCESS;
}
@@ -132,8 +112,6 @@ static int load_module(void)
{
int res;
if (parse_config(0))
return AST_MODULE_LOAD_DECLINE;
res = ast_register_translator(&alawtolin);
if (!res)
res = ast_register_translator(&lintoalaw);