iax tweak

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2234 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-08-07 19:45:52 +00:00
parent 5eb2b89d4a
commit 2b320e25a1
1 changed files with 9 additions and 5 deletions

View File

@ -239,10 +239,9 @@ static switch_status_t iax_set_codec(struct private_object *tech_pvt, struct iax
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 @@ static switch_status_t iax_set_codec(struct private_object *tech_pvt, struct iax
}
leading = iana2ast(codecs[0]->ianacode);
interval = codecs[0]->microseconds_per_frame / 1000;
if (io == IAX_QUERY) {
chosen = leading;
*format = chosen;
@ -638,8 +638,12 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
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 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
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);
}