mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 20:08:17 +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:
@@ -142,7 +142,6 @@ static struct ast_translator g722tolin = {
|
||||
.desc_size = sizeof(struct g722_decoder_pvt),
|
||||
.buffer_samples = BUFFER_SAMPLES / sizeof(int16_t),
|
||||
.buf_size = BUFFER_SAMPLES,
|
||||
.plc_samples = 160,
|
||||
};
|
||||
|
||||
static struct ast_translator lintog722 = {
|
||||
@@ -167,7 +166,6 @@ static struct ast_translator g722tolin16 = {
|
||||
.desc_size = sizeof(struct g722_decoder_pvt),
|
||||
.buffer_samples = BUFFER_SAMPLES / sizeof(int16_t),
|
||||
.buf_size = BUFFER_SAMPLES,
|
||||
.plc_samples = 160,
|
||||
};
|
||||
|
||||
static struct ast_translator lin16tog722 = {
|
||||
@@ -182,29 +180,8 @@ static struct ast_translator lin16tog722 = {
|
||||
.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")) {
|
||||
g722tolin.useplc = ast_true(var->value) ? 1 : 0;
|
||||
ast_verb(3, "codec_g722: %susing generic PLC\n",
|
||||
g722tolin.useplc ? "" : "not ");
|
||||
}
|
||||
}
|
||||
ast_config_destroy(cfg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reload(void)
|
||||
{
|
||||
if (parse_config(1))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
return AST_MODULE_LOAD_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -224,9 +201,6 @@ static int load_module(void)
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
if (parse_config(0))
|
||||
return AST_MODULE_LOAD_DECLINE;
|
||||
|
||||
res |= ast_register_translator(&g722tolin);
|
||||
res |= ast_register_translator(&lintog722);
|
||||
res |= ast_register_translator(&g722tolin16);
|
||||
|
||||
Reference in New Issue
Block a user