summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2010-07-22 14:58:01 +0000
committerMark Michelson <mmichelson@digium.com>2010-07-22 14:58:01 +0000
commit0da891c543e7e204b2c32f6a0e08d47555791f2a (patch)
tree0af02aaf6df04ce0e54ffd63150dcd125e6701dd /main/channel.c
parent3819ba7ac7c7df20457ddc41d128cc8f8cf44d18 (diff)
Merged revisions 278618 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r278618 | mmichelson | 2010-07-22 09:55:04 -0500 (Thu, 22 Jul 2010) | 13 lines Allow PLC to function properly when channels use SLIN for audio. If a channel involved in a bridge was using SLIN audio, then translation paths were not guaranteed to be set up properly since in all likelihood the number of translation steps was only 1. This patch enforces the transcode_via_slin behavior if transcode_via_slin or generic_plc is enabled and one of the formats to make compatible is SLIN. AST-352 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 6519c9ead..175f9d19f 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -5418,6 +5418,7 @@ int ast_channel_sendurl(struct ast_channel *chan, const char *url)
static int ast_channel_make_compatible_helper(struct ast_channel *from, struct ast_channel *to)
{
format_t src, dst;
+ int use_slin;
/* See if the channel driver can natively make these two channels compatible */
if (from->tech->bridge && from->tech->bridge == to->tech->bridge &&
@@ -5449,8 +5450,9 @@ static int ast_channel_make_compatible_helper(struct ast_channel *from, struct a
* no direct conversion available. If generic PLC is
* desired, then transcoding via SLINEAR is a requirement
*/
+ use_slin = (src == AST_FORMAT_SLINEAR || dst == AST_FORMAT_SLINEAR);
if ((src != dst) && (ast_opt_generic_plc || ast_opt_transcode_via_slin) &&
- (ast_translate_path_steps(dst, src) != 1))
+ (ast_translate_path_steps(dst, src) != 1 || use_slin))
dst = AST_FORMAT_SLINEAR;
if (ast_set_read_format(from, dst) < 0) {
ast_log(LOG_WARNING, "Unable to set read format on channel %s to %s\n", from->name, ast_getformatname(dst));