]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use the constant that I really meant to use here ...
authorRussell Bryant <russell@russellbryant.com>
Thu, 27 Dec 2007 14:44:29 +0000 (14:44 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 27 Dec 2007 14:44:29 +0000 (14:44 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94829 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/translate.h
main/translate.c

index ec939e6b59958ee2f4d7e9ed29d14f8ee1f90f74..54bdc067d216cbc70b758cc11849902091570c31 100644 (file)
@@ -23,7 +23,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)
index 84e255f5222d79562044a89b035aa0c2e9a7dab5..e01ce93212e8af231a71b146b86b9f1bf0077092 100644 (file)
@@ -799,7 +799,7 @@ int ast_translator_best_choice(int *dst, int *srcs)
        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 <= AST_FORMAT_MAX_AUDIO; cur <<= 1, y++) {
+               for (cur = 1, y = 0; y <= MAX_AUDIO_FORMAT; cur <<= 1, y++) {
                        if (cur & common)       /* guaranteed to find one */
                                break;
                }
@@ -808,10 +808,10 @@ int ast_translator_best_choice(int *dst, int *srcs)
                return 0;
        } else {        /* No, we will need to translate */
                AST_LIST_LOCK(&translators);
-               for (cur = 1, y = 0; y <= AST_FORMAT_MAX_AUDIO; 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 <= AST_FORMAT_MAX_AUDIO; 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 */