[Freeswitch-svn] [commit] r5969 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Thu Oct 18 12:44:11 EDT 2007
Author: anthm
Date: Thu Oct 18 12:44:11 2007
New Revision: 5969
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
Log:
stupid g722
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Thu Oct 18 12:44:11 2007
@@ -87,7 +87,7 @@
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->pt);
} else if (tech_pvt->num_codecs) {
int i;
- int already_did[256] = { 0 };
+ int already_did[128] = { 0 };
for (i = 0; i < tech_pvt->num_codecs; i++) {
const switch_codec_implementation_t *imp = tech_pvt->codecs[i];
@@ -95,11 +95,13 @@
continue;
}
- if (already_did[imp->ianacode]) {
- continue;
- }
+ if (imp->ianacode < 128) {
+ if (already_did[imp->ianacode]) {
+ continue;
+ }
- already_did[imp->ianacode] = 1;
+ already_did[imp->ianacode] = 1;
+ }
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", imp->ianacode);
if (!ptime) {
@@ -133,7 +135,7 @@
} else if (tech_pvt->num_codecs) {
int i;
- int already_did[256] = { 0 };
+ int already_did[128] = { 0 };
for (i = 0; i < tech_pvt->num_codecs; i++) {
const switch_codec_implementation_t *imp = tech_pvt->codecs[i];
@@ -141,11 +143,13 @@
continue;
}
- if (already_did[imp->ianacode]) {
- continue;
+ if (imp->ianacode < 128) {
+ if (already_did[imp->ianacode]) {
+ continue;
+ }
+
+ already_did[imp->ianacode] = 1;
}
-
- already_did[imp->ianacode] = 1;
rate = imp->samples_per_second;
@@ -189,7 +193,7 @@
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->video_pt);
} else if (tech_pvt->num_codecs) {
int i;
- int already_did[256] = { 0 };
+ int already_did[128] = { 0 };
for (i = 0; i < tech_pvt->num_codecs; i++) {
const switch_codec_implementation_t *imp = tech_pvt->codecs[i];
@@ -197,12 +201,14 @@
continue;
}
- if (already_did[imp->ianacode]) {
- continue;
- }
-
- already_did[imp->ianacode] = 1;
+ if (imp->ianacode < 128) {
+ if (already_did[imp->ianacode]) {
+ continue;
+ }
+ already_did[imp->ianacode] = 1;
+ }
+
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", imp->ianacode);
if (!ptime) {
ptime = imp->microseconds_per_frame / 1000;
@@ -220,7 +226,7 @@
}
} else if (tech_pvt->num_codecs) {
int i;
- int already_did[256] = { 0 };
+ int already_did[128] = { 0 };
for (i = 0; i < tech_pvt->num_codecs; i++) {
const switch_codec_implementation_t *imp = tech_pvt->codecs[i];
@@ -228,12 +234,14 @@
continue;
}
- if (already_did[imp->ianacode]) {
- continue;
+ if (imp->ianacode < 128) {
+ if (already_did[imp->ianacode]) {
+ continue;
+ }
+
+ already_did[imp->ianacode] = 1;
}
- already_did[imp->ianacode] = 1;
-
if (!rate) {
rate = imp->samples_per_second;
}
@@ -1242,7 +1250,11 @@
if (imp->codec_type != SWITCH_CODEC_TYPE_AUDIO) {
continue;
}
-
+
+ if (imp->ianacode == 9) {
+ codec_rate = 8000;
+ }
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Audio Codec Compare [%s:%d:%u]/[%s:%d:%u]\n",
rm_encoding, map->rm_pt, (int)map->rm_rate, imp->iananame, imp->ianacode, codec_rate);
if (map->rm_pt < 96) {
More information about the Freeswitch-svn
mailing list