提交 2b320e25 authored 作者: Anthony Minessale's avatar Anthony Minessale

iax tweak

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2234 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 5eb2b89d
......@@ -239,8 +239,7 @@ 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);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论