[asterisk-commits] mmichelson: branch 1.4 r278618 - /branches/1.4/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 22 09:55:08 CDT 2010


Author: mmichelson
Date: Thu Jul 22 09:55:04 2010
New Revision: 278618

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=278618
Log:
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


Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/channel.c?view=diff&rev=278618&r1=278617&r2=278618
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Thu Jul 22 09:55:04 2010
@@ -3768,6 +3768,7 @@
 {
 	int src;
 	int dst;
+	int use_slin;
 
 	if (chan->readformat == peer->writeformat && chan->writeformat == peer->readformat) {
 		/* Already compatible!  Moving on ... */
@@ -3812,8 +3813,9 @@
 	 * 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);




More information about the asterisk-commits mailing list