[asterisk-commits] mmichelson: trunk r98047 - /trunk/main/translate.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 10 18:54:55 CST 2008


Author: mmichelson
Date: Thu Jan 10 18:54:54 2008
New Revision: 98047

URL: http://svn.digium.com/view/asterisk?view=rev&rev=98047
Log:
Fix "core show translation" to not output information for "unknown" codecs.
This fix was made in favor of the proposed patch since it doesn't involve changing
a core codec define.

(closes issue #11722, reported and initially patched by caio1982, final patch by me)


Modified:
    trunk/main/translate.c

Modified: trunk/main/translate.c
URL: http://svn.digium.com/view/asterisk/trunk/main/translate.c?view=diff&rev=98047&r1=98046&r2=98047
==============================================================================
--- trunk/main/translate.c (original)
+++ trunk/main/translate.c Thu Jan 10 18:54:54 2008
@@ -557,9 +557,14 @@
 	}
 	for (x = -1; x < SHOW_TRANS; x++) {
 		struct ast_str *out = ast_str_alloca(120);
-		
+		/*Go ahead and move to next iteration if dealing with an unknown codec*/
+		if(x >= 0 && !strcmp(ast_getformatname(1 << (x)), "unknown"))
+			continue;
 		ast_str_set(&out, -1, " ");
 		for (y = -1; y < SHOW_TRANS; y++) {
+			/*Go ahead and move to next iteration if dealing with an unknown codec*/
+			if (y >= 0 && !strcmp(ast_getformatname(1 << (y)), "unknown"))
+				continue;
 			if (y >= 0)
 				curlen = strlen(ast_getformatname(1 << (y)));
 			if (curlen < 5)




More information about the asterisk-commits mailing list