From 2977c5a03e59ade186502d9867158419b7d0f727 Mon Sep 17 00:00:00 2001 From: markster Date: Sat, 18 May 2002 02:35:06 +0000 Subject: Version 0.1.12 from FTP git-svn-id: http://svn.digium.com/svn/asterisk/trunk@451 f38db490-d61c-443f-a65b-d21fe96a405b --- translate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'translate.c') diff --git a/translate.c b/translate.c index 788436023..0c5b1ddbf 100755 --- a/translate.c +++ b/translate.c @@ -11,6 +11,7 @@ * the GNU General Public License */ +#include #include #include #include @@ -19,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +39,7 @@ /* This could all be done more efficiently *IF* we chained packets together by default, but it would also complicate virtually every application. */ -static pthread_mutex_t list_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t list_lock = AST_MUTEX_INITIALIZER; static struct ast_translator *list = NULL; struct ast_translator_dir { @@ -106,6 +108,7 @@ struct ast_trans_pvt *ast_translator_build_path(int dest, int source) tmp->step = tr_matrix[source][dest].step; tmp->state = tmp->step->new(); if (!tmp->state) { + ast_log(LOG_WARNING, "Failed to build translator step from %d to %d\n", source, dest); free(tmp); tmp = NULL; return NULL; @@ -287,6 +290,7 @@ static struct ast_cli_entry show_trans = int ast_register_translator(struct ast_translator *t) { + char tmp[80]; t->srcfmt = powerof(t->srcfmt); t->dstfmt = powerof(t->dstfmt); if ((t->srcfmt >= MAX_FORMAT) || (t->dstfmt >= MAX_FORMAT)) { @@ -295,7 +299,7 @@ int ast_register_translator(struct ast_translator *t) } calc_cost(t); if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Registered translator '%s' from format %d to %d, cost %d\n", t->name, t->srcfmt, t->dstfmt, t->cost); + ast_verbose(VERBOSE_PREFIX_2 "Registered translator '%s' from format %d to %d, cost %d\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), t->srcfmt, t->dstfmt, t->cost); ast_pthread_mutex_lock(&list_lock); if (!added_cli) { ast_cli_register(&show_trans); -- cgit v1.2.3