aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-22 15:00:11 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-22 15:00:11 +0000
commit2904db462f4fa45bc56b0226c3673ec0d1aef2c9 (patch)
tree77a2a1d1edccd51dc6d396c04bb8c1b3e5d5ef48
parentfad7bde3563ada4766a5fb0d1a73a81541293973 (diff)
Merged revisions 278620 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r278620 | mmichelson | 2010-07-22 09:58:01 -0500 (Thu, 22 Jul 2010) | 19 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.2@278621 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 2e69827f0..fdb88a8d1 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -4356,6 +4356,7 @@ static int ast_channel_make_compatible_helper(struct ast_channel *from, struct a
{
int src;
int dst;
+ int use_slin;
if (from->readformat == to->writeformat && from->writeformat == to->readformat) {
/* Already compatible! Moving on ... */
@@ -4381,8 +4382,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 %d\n", from->name, dst);