aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-17 16:42:03 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-17 16:42:03 +0000
commit34fbed82538f271aae21f2dfd53f27d2bc824f18 (patch)
treeb735c7926aa7d05b342681178456bb8047404cf0 /channel.c
parent07ac7ea7852bce07a852618734723b389a9b6b2b (diff)
add an API so that the number of steps required for a translation path can be acquired
don't transcode via SLINEAR when the option is enabled but there is a direct path from the source to the destination git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20962 f38db490-d61c-443f-a65b-d21fe96a405b
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);