[asterisk-commits] russell: branch 1.4 r46554 - /branches/1.4/main/translate.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Oct 30 22:55:07 MST 2006


Author: russell
Date: Mon Oct 30 23:55:07 2006
New Revision: 46554

URL: http://svn.digium.com/view/asterisk?rev=46554&view=rev
Log:
Add a small tweak to the code that checks to see whether destination formats
are translatable based on the source format.  If we have already determined
that there is no translation path in one direction, don't bother checking the
other direction.

Modified:
    branches/1.4/main/translate.c

Modified: branches/1.4/main/translate.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/translate.c?rev=46554&r1=46553&r2=46554&view=diff
==============================================================================
--- branches/1.4/main/translate.c (original)
+++ branches/1.4/main/translate.c Mon Oct 30 23:55:07 2006
@@ -855,13 +855,14 @@
 
 		/* if we don't have a translation path from the src
 		   to this format, remove it from the result */
-		if (!tr_matrix[src_audio][powerof(x)].step)
+		if (!tr_matrix[src_audio][powerof(x)].step) {
 			res &= ~x;
+			continue;
+		}
 
 		/* now check the opposite direction */
 		if (!tr_matrix[powerof(x)][src_audio].step)
 			res &= ~x;
-
 	}
 
 	/* For a given source video format, traverse the list of
@@ -880,8 +881,10 @@
 
 		/* if we don't have a translation path from the src
 		   to this format, remove it from the result */
-		if (!tr_matrix[src_video][powerof(x)].step)
+		if (!tr_matrix[src_video][powerof(x)].step) {
 			res &= ~x;
+			continue;
+		}
 
 		/* now check the opposite direction */
 		if (!tr_matrix[powerof(x)][src_video].step)



More information about the asterisk-commits mailing list