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);
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);
}
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);
}
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);
}
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);
}
//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);
}
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
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