diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-31 06:10:59 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-31 06:10:59 +0000 |
commit | 97b529965161f55441b7dea8e8c89802c4a3c455 (patch) | |
tree | 189b0c0b0e84c6e5c648f64f6090a33dc43dc6e7 | |
parent | 2fad9467dc89be9d6bbe0dccb94149e15633f4bd (diff) |
Merged revisions 46554 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r46554 | russell | 2006-10-31 00:55:07 -0500 (Tue, 31 Oct 2006) | 5 lines
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/trunk@46556 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/translate.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/main/translate.c b/main/translate.c index 136537ea6..740570855 100644 --- a/main/translate.c +++ b/main/translate.c @@ -781,13 +781,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 @@ -806,8 +807,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) |