diff options
Diffstat (limited to 'channel.c')
-rw-r--r-- | channel.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -2744,8 +2744,9 @@ int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *pe /* if the best path is not 'pass through', then transcoding is needed; if desired, force transcode path - to use SLINEAR between channels */ - if ((src != dst) && ast_opt_transcode_via_slin) + 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)) 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); @@ -2763,10 +2764,12 @@ int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *pe ast_log(LOG_WARNING, "No path to translate from %s(%d) to %s(%d)\n", peer->name, src, chan->name, dst); return -1; } + /* if the best path is not 'pass through', then transcoding is needed; if desired, force transcode path - to use SLINEAR between channels */ - if ((src != dst) && ast_opt_transcode_via_slin) + 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)) 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); |