提交 5314971b authored 作者: Jeff Lenk's avatar Jeff Lenk

MODENDP-245 BIGENDIAN Windows Bug

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15410 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 80922afd
...@@ -636,9 +636,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch ...@@ -636,9 +636,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
tech_pvt->read_frame->codec = &tech_pvt->read_codec; tech_pvt->read_frame->codec = &tech_pvt->read_codec;
*frame = tech_pvt->read_frame; *frame = tech_pvt->read_frame;
#ifdef BIGENDIAN #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) {
switch_swap_linear((*frame)->data, (int) (*frame)->datalen); switch_swap_linear((*frame)->data, (int) (*frame)->datalen / 2);
} }
#endif #endif
switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); switch_clear_flag_locked(tech_pvt, TFLAG_VOICE);
...@@ -674,7 +674,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc ...@@ -674,7 +674,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;
} }
#ifdef BIGENDIAN #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
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);
} }
......
...@@ -318,7 +318,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch ...@@ -318,7 +318,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
continue; continue;
} }
*frame = &tech_pvt->read_frame; *frame = &tech_pvt->read_frame;
#ifdef BIGENDIAN #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
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);
} }
...@@ -358,7 +358,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc ...@@ -358,7 +358,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;
} }
#ifdef BIGENDIAN #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
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);
} }
......
...@@ -689,7 +689,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch ...@@ -689,7 +689,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
continue; continue;
} }
*frame = &tech_pvt->read_frame; *frame = &tech_pvt->read_frame;
#ifdef BIGENDIAN #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
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);
} }
...@@ -733,7 +733,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc ...@@ -733,7 +733,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
//TODO: kill the bastard //TODO: kill the bastard
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
#ifdef BIGENDIAN #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
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);
} }
......
...@@ -1089,7 +1089,7 @@ static switch_status_t unicall_read_frame(switch_core_session_t *session, switch ...@@ -1089,7 +1089,7 @@ static switch_status_t unicall_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;
#if defined(BIGENDIAN) #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
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);
#endif #endif
...@@ -1117,7 +1117,7 @@ static switch_status_t unicall_write_frame(switch_core_session_t *session, switc ...@@ -1117,7 +1117,7 @@ static switch_status_t unicall_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;
#if defined(BIGENDIAN) #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) if (switch_test_flag(tech_pvt, TFLAG_LINEAR))
switch_swap_linear(frame->data, (int) frame->datalen/sizeof(int16_t)); switch_swap_linear(frame->data, (int) frame->datalen/sizeof(int16_t));
#endif #endif
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论