diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-06 14:41:37 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-06 14:41:37 +0000 |
commit | 3fbf0276cc50c1de0b828a346088d6b40603b1ed (patch) | |
tree | 284889d1446780d2a9e25ec33af9667efedced45 /codecs | |
parent | f5c2063fbe13a4b6c24f9a5e2d7981ba10f1040b (diff) |
remove undocumented 'cardsmode' parameter and stop searching for transcoders during reload()
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@60398 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs')
-rw-r--r-- | codecs/codec_zap.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/codecs/codec_zap.c b/codecs/codec_zap.c index a4d9de6d8..0d59381a5 100644 --- a/codecs/codec_zap.c +++ b/codecs/codec_zap.c @@ -55,7 +55,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define BUFFER_SAMPLES 8000 static unsigned int global_useplc = 0; -static int cardsmode = 0; static int totalchannels = 0; static int complexinuse = 0; @@ -109,17 +108,14 @@ struct ast_translator_pvt { static int show_transcoder(int fd, int argc, char **argv) { ast_mutex_lock(&channelcount); + if (!totalchannels) { ast_cli(fd, "No transcoder card registered\n"); ast_mutex_unlock(&channelcount); return RESULT_SUCCESS; } - if(!cardsmode) - ast_cli(fd, "%d/%d encoders/decoders of %d channels (G.729a / G.723.1 5.3 kbps) are in use.\n",complexinuse, simpleinuse, totalchannels); - else if (cardsmode == 1) - ast_cli(fd, "%d/%d encoders/decoders of %d channels (G.729a) are in use.\n",complexinuse, simpleinuse, totalchannels); - else if (cardsmode == 2) - ast_cli(fd, "%d/%d encoders/decoders of %d channels (G.723.1 5.3 kbps) are in use.\n",complexinuse, simpleinuse, totalchannels); + + ast_cli(fd, "%d/%d encoders/decoders of %d channels are in use.\n", complexinuse, simpleinuse, totalchannels); ast_mutex_unlock(&channelcount); return RESULT_SUCCESS; @@ -714,8 +710,7 @@ static int register_translator(int dst, int src) ast_log(LOG_ERROR, "Could not allocate translator\n"); return -1; } - if (!((cardsmode == 1 && (dst == 8 || src == 8)) || (cardsmode == 2 && (dst == 0 || src == 0)) || (cardsmode == 0))) - return -1; + snprintf((char *) (zt->t.name), sizeof(zt->t.name), "zap%sto%s", ast_getformatname((1 << src)), ast_getformatname((1 << dst))); @@ -794,7 +789,6 @@ static void parse_config(void) { struct ast_variable *var; struct ast_config *cfg = ast_config_load("codecs.conf"); - cardsmode = 0; if (!cfg) return; @@ -806,16 +800,6 @@ static void parse_config(void) ast_verbose(VERBOSE_PREFIX_3 "codec_zap: %susing generic PLC\n", global_useplc ? "" : "not "); } } - for (var = ast_variable_browse(cfg, "transcoder_card"); var; var = var->next) { - if (!strcasecmp(var->name, "mode")) { - if(strstr(var->value, "g729")) - cardsmode = 1; - else if(strstr(var->value, "g723")) - cardsmode = 2; - else if(strstr(var->value, "mixed")) - cardsmode = 0; - } - } ast_config_destroy(cfg); } @@ -891,7 +875,6 @@ static int find_transcoders(void) int reload(void) { parse_config(); - find_transcoders(); return 0; } |