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

@@ -56,8 +56,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define G723_SAMPLES 240
#define G729_SAMPLES 160
static unsigned int global_useplc = 0;
static struct channel_usage {
int total;
int encoders;
@@ -493,29 +491,14 @@ static int register_translator(int dst, int src)
if (is_encoder(zt)) {
zt->t.framein = dahdi_encoder_framein;
zt->t.frameout = dahdi_encoder_frameout;
#if 0
zt->t.buffer_samples = 0;
#endif
} else {
zt->t.framein = dahdi_decoder_framein;
zt->t.frameout = dahdi_decoder_frameout;
#if 0
if (AST_FORMAT_G723_1 == zt->t.srcfmt) {
zt->t.plc_samples = G723_SAMPLES;
} else {
zt->t.plc_samples = G729_SAMPLES;
}
zt->t.buffer_samples = zt->t.plc_samples * 8;
#endif
}
zt->t.destroy = dahdi_destroy;
zt->t.buffer_samples = 0;
zt->t.newpvt = dahdi_new;
zt->t.sample = fakesrc_sample;
#if 0
zt->t.useplc = global_useplc;
#endif
zt->t.useplc = 0;
zt->t.native_plc = 0;
zt->t.desc_size = sizeof(struct codec_dahdi_pvt);
@@ -567,27 +550,6 @@ static void unregister_translators(void)
AST_LIST_UNLOCK(&translators);
}
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")) {
global_useplc = ast_true(var->value);
ast_verb(3, "codec_dahdi: %susing generic PLC\n",
global_useplc ? "" : "not ");
}
}
ast_config_destroy(cfg);
return 0;
}
static void build_translators(struct format_map *map, unsigned int dstfmts, unsigned int srcfmts)
{
unsigned int src, dst;
@@ -664,14 +626,6 @@ static int reload(void)
{
struct translator *cur;
if (parse_config(1))
return AST_MODULE_LOAD_DECLINE;
AST_LIST_LOCK(&translators);
AST_LIST_TRAVERSE(&translators, cur, entry)
cur->t.useplc = global_useplc;
AST_LIST_UNLOCK(&translators);
return AST_MODULE_LOAD_SUCCESS;
}
@@ -686,8 +640,6 @@ static int unload_module(void)
static int load_module(void)
{
ast_ulaw_init();
if (parse_config(0))
return AST_MODULE_LOAD_DECLINE;
find_transcoders();
ast_cli_register_multiple(cli, ARRAY_LEN(cli));
return AST_MODULE_LOAD_SUCCESS;