Revision
15410
Author
jlenk
Date
2009-11-10 11:28:39 -0600 (Tue, 10 Nov 2009)

Log Message

MODENDP-245 BIGENDIAN Windows Bug

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c (15409 => 15410)


--- freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c	2009-11-10 16:26:11 UTC (rev 15409)
+++ freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c	2009-11-10 17:28:39 UTC (rev 15410)
@@ -636,9 +636,9 @@
 			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 @@
 	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);
 	}

Modified: freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c (15409 => 15410)


--- freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c	2009-11-10 16:26:11 UTC (rev 15409)
+++ freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c	2009-11-10 17:28:39 UTC (rev 15410)
@@ -318,7 +318,7 @@
 				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 @@
 	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);
 	}

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (15409 => 15410)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2009-11-10 16:26:11 UTC (rev 15409)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2009-11-10 17:28:39 UTC (rev 15410)
@@ -689,7 +689,7 @@
 				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 @@
 		//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);
 	}

Modified: freeswitch/trunk/src/mod/endpoints/mod_unicall/mod_unicall.c (15409 => 15410)


--- freeswitch/trunk/src/mod/endpoints/mod_unicall/mod_unicall.c	2009-11-10 16:26:11 UTC (rev 15409)
+++ freeswitch/trunk/src/mod/endpoints/mod_unicall/mod_unicall.c	2009-11-10 17:28:39 UTC (rev 15410)
@@ -1089,7 +1089,7 @@
             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 @@
 
     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