summaryrefslogtreecommitdiff
path: root/translate.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-04-17 16:42:03 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-04-17 16:42:03 +0000
commit987f24840c089a401ea34bbdf3be65a1b1671fef (patch)
treeb735c7926aa7d05b342681178456bb8047404cf0 /translate.c
parent080298dad42e1fe677118acb83e51d7a9806d382 (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: https://origsvn.digium.com/svn/asterisk/trunk@20962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'translate.c')
-rw-r--r--translate.c10
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;
+}