aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/channel.c b/channel.c
index 743cbc53c..ea14aba6d 100644
--- a/channel.c
+++ b/channel.c
@@ -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);