aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-31 05:55:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-31 05:55:07 +0000
commit0f22fbab76b44a41fc54c9dc1f1b920741b8c6bf (patch)
tree78895ccb205cea27b62aaa20cdcede55577059a8
parent03992471e5b544baaad55c709448c0d1e20286a7 (diff)
Add a small tweak to the code that checks to see whether destination formats
are translatable based on the source format. If we have already determined that there is no translation path in one direction, don't bother checking the other direction. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46554 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/translate.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/main/translate.c b/main/translate.c
index f3918d9d2..c7172619b 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -855,13 +855,14 @@ unsigned int ast_translate_available_formats(unsigned int dest, unsigned int src
/* if we don't have a translation path from the src
to this format, remove it from the result */
- if (!tr_matrix[src_audio][powerof(x)].step)
+ if (!tr_matrix[src_audio][powerof(x)].step) {
res &= ~x;
+ continue;
+ }
/* now check the opposite direction */
if (!tr_matrix[powerof(x)][src_audio].step)
res &= ~x;
-
}
/* For a given source video format, traverse the list of
@@ -880,8 +881,10 @@ unsigned int ast_translate_available_formats(unsigned int dest, unsigned int src
/* if we don't have a translation path from the src
to this format, remove it from the result */
- if (!tr_matrix[src_video][powerof(x)].step)
+ if (!tr_matrix[src_video][powerof(x)].step) {
res &= ~x;
+ continue;
+ }
/* now check the opposite direction */
if (!tr_matrix[powerof(x)][src_video].step)