actually return the number steps... not the number of steps minus 1
authorKevin P. Fleming <kpfleming@digium.com>
Mon, 17 Apr 2006 16:43:55 +0000 (16:43 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Mon, 17 Apr 2006 16:43:55 +0000 (16:43 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20964 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c
translate.c

index ea14aba..230aa13 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -2746,7 +2746,8 @@ int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *pe
           transcoding is needed; if desired, force transcode path
           to use SLINEAR between channels, but only if there is
           no direct conversion available */
           transcoding is needed; if desired, force transcode path
           to use SLINEAR between channels, but only if there is
           no direct conversion available */
-       if ((src != dst) && ast_opt_transcode_via_slin && ast_translate_path_steps(dst, src))
+       if ((src != dst) && ast_opt_transcode_via_slin &&
+           (ast_translate_path_steps(dst, src) != 1))
                dst = AST_FORMAT_SLINEAR;
        if (ast_set_read_format(chan, dst) < 0) {
                ast_log(LOG_WARNING, "Unable to set read format on channel %s to %d\n", chan->name, dst);
                dst = AST_FORMAT_SLINEAR;
        if (ast_set_read_format(chan, dst) < 0) {
                ast_log(LOG_WARNING, "Unable to set read format on channel %s to %d\n", chan->name, dst);
@@ -2769,7 +2770,8 @@ int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *pe
           transcoding is needed; if desired, force transcode path
           to use SLINEAR between channels, but only if there is
           no direct conversion available */
           transcoding is needed; if desired, force transcode path
           to use SLINEAR between channels, but only if there is
           no direct conversion available */
-       if ((src != dst) && ast_opt_transcode_via_slin && ast_translate_path_steps(dst, src))
+       if ((src != dst) && ast_opt_transcode_via_slin &&
+           (ast_translate_path_steps(dst, src) != 1))
                dst = AST_FORMAT_SLINEAR;
        if (ast_set_read_format(peer, dst) < 0) {
                ast_log(LOG_WARNING, "Unable to set read format on channel %s to %d\n", peer->name, dst);
                dst = AST_FORMAT_SLINEAR;
        if (ast_set_read_format(peer, dst) < 0) {
                ast_log(LOG_WARNING, "Unable to set read format on channel %s to %d\n", peer->name, dst);
index dce4b08..0edfa54 100644 (file)
@@ -659,5 +659,5 @@ unsigned int ast_translate_path_steps(unsigned int dest, unsigned int src)
        if (!tr_matrix[src][dest].step)
                return -1;
        else
        if (!tr_matrix[src][dest].step)
                return -1;
        else
-               return tr_matrix[src][dest].multistep;
+               return tr_matrix[src][dest].multistep + 1;
 }
 }