diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-17 16:42:03 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-17 16:42:03 +0000 |
commit | 34fbed82538f271aae21f2dfd53f27d2bc824f18 (patch) | |
tree | b735c7926aa7d05b342681178456bb8047404cf0 /translate.c | |
parent | 07ac7ea7852bce07a852618734723b389a9b6b2b (diff) |
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
Diffstat (limited to 'translate.c')
-rw-r--r-- | translate.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; +} |