mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-10 23:07:05 +00:00
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. Review: https://reviewboard.asterisk.org/r/683/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
@@ -489,29 +487,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);
|
||||
@@ -563,27 +546,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;
|
||||
@@ -660,14 +622,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;
|
||||
}
|
||||
|
||||
@@ -682,8 +636,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;
|
||||
|
Reference in New Issue
Block a user