[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r337306 - /team/irroot/distrot...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 21 06:49:57 CDT 2011


Author: irroot
Date: Wed Sep 21 06:42:12 2011
New Revision: 337306

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=337306
Log:
Only fix write format when transcoding is needed

Modified:
    team/irroot/distrotech-customers-1.8/main/channel.c

Modified: team/irroot/distrotech-customers-1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/main/channel.c?view=diff&rev=337306&r1=337305&r2=337306
==============================================================================
--- team/irroot/distrotech-customers-1.8/main/channel.c (original)
+++ team/irroot/distrotech-customers-1.8/main/channel.c Wed Sep 21 06:42:12 2011
@@ -4893,25 +4893,26 @@
 			apply_plc(chan, fr);
 		}
 
-		/* XXX Something is not right we are not compatible with this frame bad things can happen
-		 * problems range from no/one-way audio to unexplained line hangups as a last resort try adjust the format
-		 * ideally we do not want to do this and this indicates a deeper problem for now we log these events to
-		 * eliminate user impact and help identify the problem areas
-		 * JIRA issues related to this :-
-		 * ASTERISK-14384, ASTERISK-17502, ASTERISK-17541, ASTERISK-18063, ASTERISK-18325, ASTERISK-18422*/
-		if ((!(fr->subclass.codec & chan->nativeformats)) && (chan->writeformat != fr->subclass.codec)) {
-			char nf[512];
-			ast_log(LOG_WARNING, "Codec mismatch on channel %s setting write format to %s from %s native formats %s\n",
-				chan->name, ast_getformatname(fr->subclass.codec), ast_getformatname(chan->writeformat),
-				ast_getformatname_multiple(nf, sizeof(nf), chan->nativeformats & AST_FORMAT_AUDIO_MASK));
-			ast_set_write_format(chan, fr->subclass.codec);
-		}
-
 		/* If the frame is in the raw write format, then it's easy... just use the frame - otherwise we will have to translate */
-		if (fr->subclass.codec == chan->rawwriteformat)
+		if (fr->subclass.codec == chan->rawwriteformat) {
 			f = fr;
-		else
+		} else {
+			/* XXX Something is not right we are not compatible with this frame bad things can happen
+			 * problems range from no/one-way audio to unexplained line hangups as a last resort try adjust the format
+			 * ideally we do not want to do this and this indicates a deeper problem for now we log these events to
+			 * eliminate user impact and help identify the problem areas
+			 * JIRA issues related to this :-
+			 * ASTERISK-14384, ASTERISK-17502, ASTERISK-17541, ASTERISK-18063, ASTERISK-18325, ASTERISK-18422*/
+			if ((!(fr->subclass.codec & chan->nativeformats)) && (chan->writeformat != fr->subclass.codec)) {
+				char nf[512];
+				ast_log(LOG_WARNING, "Codec mismatch on channel %s setting write format to %s from %s native formats %s\n",
+					chan->name, ast_getformatname(fr->subclass.codec), ast_getformatname(chan->writeformat),
+					ast_getformatname_multiple(nf, sizeof(nf), chan->nativeformats & AST_FORMAT_AUDIO_MASK));
+				ast_set_write_format(chan, fr->subclass.codec);
+			}
+
 			f = (chan->writetrans) ? ast_translate(chan->writetrans, fr, 0) : fr;
+		}
 
 		if (!f) {
 			res = 0;




More information about the asterisk-commits mailing list