iax tweak
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2234 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
5eb2b89d4a
commit
2b320e25a1
|
@ -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;
|
static const switch_codec_implementation_t *imp;
|
||||||
for (imp = codecs[x]; imp; imp = imp->next) {
|
for (imp = codecs[x]; imp; imp = imp->next) {
|
||||||
unsigned int codec = iana2ast(imp->ianacode);
|
unsigned int codec = iana2ast(imp->ianacode);
|
||||||
|
if (io == IAX_QUERY && !(codec & local_cap)) {
|
||||||
if (io == IAX_QUERY) {
|
|
||||||
iax_pref_codec_add(iax_session, codec);
|
iax_pref_codec_add(iax_session, codec);
|
||||||
}
|
}
|
||||||
local_cap |= 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);
|
leading = iana2ast(codecs[0]->ianacode);
|
||||||
|
interval = codecs[0]->microseconds_per_frame / 1000;
|
||||||
if (io == IAX_QUERY) {
|
if (io == IAX_QUERY) {
|
||||||
chosen = leading;
|
chosen = leading;
|
||||||
*format = chosen;
|
*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) {
|
if (!tech_pvt->read_frame.datalen) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
*frame = &tech_pvt->read_frame;
|
*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;
|
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)) {
|
if (!switch_test_flag(tech_pvt, TFLAG_IO)) {
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
#ifndef BIGENDIAN
|
#ifdef BIGENDIAN
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) {
|
if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) {
|
||||||
switch_swap_linear(frame->data, (int) frame->datalen / 2);
|
switch_swap_linear(frame->data, (int) frame->datalen / 2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue