[asterisk-commits] russell: trunk r94830 - in /trunk: ./ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 27 08:52:08 CST 2007


Author: russell
Date: Thu Dec 27 08:52:07 2007
New Revision: 94830

URL: http://svn.digium.com/view/asterisk?view=rev&rev=94830
Log:
Merged revisions 94828-94829 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r94828 | russell | 2007-12-27 08:33:21 -0600 (Thu, 27 Dec 2007) | 9 lines

Change ast_translator_best_choice() to only pay attention to audio formats.
This fixes a problem where Asterisk claims that a translation path can not be
found for channels involving video.

(closes issue #11638)
Reported by: cwhuang
Tested by: cwhuang
Patch suggested by cwhuang, with some additional changes by me.

........
r94829 | russell | 2007-12-27 08:44:29 -0600 (Thu, 27 Dec 2007) | 2 lines

Use the constant that I really meant to use here ...

........

Modified:
    trunk/   (props changed)
    trunk/include/asterisk/translate.h
    trunk/main/translate.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/include/asterisk/translate.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/translate.h?view=diff&rev=94830&r1=94829&r2=94830
==============================================================================
--- trunk/include/asterisk/translate.h (original)
+++ trunk/include/asterisk/translate.h Thu Dec 27 08:52:07 2007
@@ -24,7 +24,7 @@
 #ifndef _ASTERISK_TRANSLATE_H
 #define _ASTERISK_TRANSLATE_H
 
-//#define MAX_FORMAT 15	/* Do not include video here */
+#define MAX_AUDIO_FORMAT 15 /* Do not include video here */
 #define MAX_FORMAT 32	/* Do include video here */
 
 #if defined(__cplusplus) || defined(c_plusplus)

Modified: trunk/main/translate.c
URL: http://svn.digium.com/view/asterisk/trunk/main/translate.c?view=diff&rev=94830&r1=94829&r2=94830
==============================================================================
--- trunk/main/translate.c (original)
+++ trunk/main/translate.c Thu Dec 27 08:52:07 2007
@@ -717,10 +717,10 @@
 	int cur, cursrc;
 	int besttime = INT_MAX;
 	int beststeps = INT_MAX;
-	int common = (*dst) & (*srcs);	/* are there common formats ? */
+	int common = ((*dst) & (*srcs)) & AST_FORMAT_AUDIO_MASK;	/* are there common formats ? */
 
 	if (common) { /* yes, pick one and return */
-		for (cur = 1, y = 0; y < MAX_FORMAT; cur <<= 1, y++) {
+		for (cur = 1, y = 0; y <= MAX_AUDIO_FORMAT; cur <<= 1, y++) {
 			if (cur & common)	/* guaranteed to find one */
 				break;
 		}
@@ -729,10 +729,10 @@
 		return 0;
 	} else {	/* No, we will need to translate */
 		AST_RWLIST_RDLOCK(&translators);
-		for (cur = 1, y = 0; y < MAX_FORMAT; cur <<= 1, y++) {
+		for (cur = 1, y = 0; y <= MAX_AUDIO_FORMAT; cur <<= 1, y++) {
 			if (! (cur & *dst))
 				continue;
-			for (cursrc = 1, x = 0; x < MAX_FORMAT; cursrc <<= 1, x++) {
+			for (cursrc = 1, x = 0; x <= MAX_AUDIO_FORMAT; cursrc <<= 1, x++) {
 				if (!(*srcs & cursrc) || !tr_matrix[x][y].step ||
 				    tr_matrix[x][y].cost >  besttime)
 					continue;	/* not existing or no better */




More information about the asterisk-commits mailing list