From 34fbed82538f271aae21f2dfd53f27d2bc824f18 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Mon, 17 Apr 2006 16:42:03 +0000 Subject: add an API so that the number of steps required for a translation path can be acquired don't transcode via SLINEAR when the option is enabled but there is a direct path from the source to the destination git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20962 f38db490-d61c-443f-a65b-d21fe96a405b --- translate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'translate.c') diff --git a/translate.c b/translate.c index 20da09113..dce4b0827 100644 --- a/translate.c +++ b/translate.c @@ -62,6 +62,8 @@ struct translator_path { * indicates the total cost of translation and the first step. * The full path can be reconstricted iterating on the matrix * until step->dstfmt == desired_format. + * + * Array indexes are 'src' and 'dest', in that order. */ static struct translator_path tr_matrix[MAX_FORMAT][MAX_FORMAT]; @@ -651,3 +653,11 @@ int ast_translator_best_choice(int *dst, int *srcs) return best; } } + +unsigned int ast_translate_path_steps(unsigned int dest, unsigned int src) +{ + if (!tr_matrix[src][dest].step) + return -1; + else + return tr_matrix[src][dest].multistep; +} -- cgit v1.2.3