[Freeswitch-svn] [commit] r2234 - freeswitch/trunk/src/mod/endpoints/mod_iax
Freeswitch SVN
anthm at freeswitch.org
Mon Aug 7 15:45:52 EDT 2006
Author: anthm
Date: Mon Aug 7 15:45:52 2006
New Revision: 2234
Modified:
freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
Log:
iax tweak
Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c Mon Aug 7 15:45:52 2006
@@ -239,10 +239,9 @@
static const switch_codec_implementation_t *imp;
for (imp = codecs[x]; imp; imp = imp->next) {
unsigned int codec = iana2ast(imp->ianacode);
-
- if (io == IAX_QUERY) {
+ if (io == IAX_QUERY && !(codec & local_cap)) {
iax_pref_codec_add(iax_session, codec);
- }
+ }
local_cap |= codec;
}
}
@@ -254,6 +253,7 @@
}
leading = iana2ast(codecs[0]->ianacode);
+ interval = codecs[0]->microseconds_per_frame / 1000;
if (io == IAX_QUERY) {
chosen = leading;
*format = chosen;
@@ -638,8 +638,12 @@
if (!tech_pvt->read_frame.datalen) {
continue;
}
-
*frame = &tech_pvt->read_frame;
+#ifdef BIGENDIAN
+ if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) {
+ switch_swap_linear((*frame)->data, (int) (*frame)->datalen);
+ }
+#endif
return SWITCH_STATUS_SUCCESS;
}
@@ -674,7 +678,7 @@
if (!switch_test_flag(tech_pvt, TFLAG_IO)) {
return SWITCH_STATUS_FALSE;
}
-#ifndef BIGENDIAN
+#ifdef BIGENDIAN
if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) {
switch_swap_linear(frame->data, (int) frame->datalen / 2);
}
More information about the Freeswitch-svn
mailing list