diff --git a/src/mod/endpoints/mod_iax/mod_iax.c b/src/mod/endpoints/mod_iax/mod_iax.c index ffe02a7c0e..219f35e227 100644 --- a/src/mod/endpoints/mod_iax/mod_iax.c +++ b/src/mod/endpoints/mod_iax/mod_iax.c @@ -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; *frame = tech_pvt->read_frame; -#ifdef BIGENDIAN +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN 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 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 if (!switch_test_flag(tech_pvt, TFLAG_IO)) { return SWITCH_STATUS_FALSE; } -#ifdef BIGENDIAN +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { switch_swap_linear(frame->data, (int) frame->datalen / 2); } diff --git a/src/mod/endpoints/mod_reference/mod_reference.c b/src/mod/endpoints/mod_reference/mod_reference.c index 2ace5a1751..4bf5b6eb64 100644 --- a/src/mod/endpoints/mod_reference/mod_reference.c +++ b/src/mod/endpoints/mod_reference/mod_reference.c @@ -318,7 +318,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch continue; } *frame = &tech_pvt->read_frame; -#ifdef BIGENDIAN +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { 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 if (!switch_test_flag(tech_pvt, TFLAG_IO)) { return SWITCH_STATUS_FALSE; } -#ifdef BIGENDIAN +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { switch_swap_linear(frame->data, (int) frame->datalen / 2); } diff --git a/src/mod/endpoints/mod_skypiax/mod_skypiax.c b/src/mod/endpoints/mod_skypiax/mod_skypiax.c index 49ea822a15..1d271b8e79 100644 --- a/src/mod/endpoints/mod_skypiax/mod_skypiax.c +++ b/src/mod/endpoints/mod_skypiax/mod_skypiax.c @@ -689,7 +689,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch continue; } *frame = &tech_pvt->read_frame; -#ifdef BIGENDIAN +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { 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 //TODO: kill the bastard return SWITCH_STATUS_FALSE; } -#ifdef BIGENDIAN +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { switch_swap_linear(frame->data, (int) frame->datalen / 2); } diff --git a/src/mod/endpoints/mod_unicall/mod_unicall.c b/src/mod/endpoints/mod_unicall/mod_unicall.c index dd43000c25..aa3353b450 100644 --- a/src/mod/endpoints/mod_unicall/mod_unicall.c +++ b/src/mod/endpoints/mod_unicall/mod_unicall.c @@ -1089,7 +1089,7 @@ static switch_status_t unicall_read_frame(switch_core_session_t *session, switch if (!tech_pvt->read_frame.datalen) continue; *frame = &tech_pvt->read_frame; -#if defined(BIGENDIAN) +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) switch_swap_linear((*frame)->data, (int) (*frame)->datalen / 2); #endif @@ -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)) return SWITCH_STATUS_FALSE; -#if defined(BIGENDIAN) +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) switch_swap_linear(frame->data, (int) frame->datalen/sizeof(int16_t)); #endif