aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-22 14:55:04 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-22 14:55:04 +0000
commitd753f39b933a87a139e3a0f25be6fbc5effeda1f (patch)
tree3602416d1873fb267ca450cafcb37d4eec4af0ac
parent59288d0f49fadae31c47d8f752de8d25f64ac3a3 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@278618 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/channel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c
index 5134cefc1..62b774a66 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3768,6 +3768,7 @@ int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *pe
{
int src;
int dst;
+ int use_slin;
if (chan->readformat == peer->writeformat && chan->writeformat == peer->readformat) {
/* Already compatible! Moving on ... */
@@ -3812,8 +3813,9 @@ int ast_channel_make_compatible(struct ast_channel *chan, struct ast_channel *pe
* 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(peer, dst) < 0) {
ast_log(LOG_WARNING, "Unable to set read format on channel %s to %d\n", peer->name, dst);