]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODENDP-245 BIGENDIAN Windows Bug
authorJeff Lenk <jeff@jefflenk.com>
Tue, 10 Nov 2009 17:28:39 +0000 (17:28 +0000)
committerJeff Lenk <jeff@jefflenk.com>
Tue, 10 Nov 2009 17:28:39 +0000 (17:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15410 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_iax/mod_iax.c
src/mod/endpoints/mod_reference/mod_reference.c
src/mod/endpoints/mod_skypiax/mod_skypiax.c
src/mod/endpoints/mod_unicall/mod_unicall.c

index ffe02a7c0e2650fb50f7a9ef6e2609cf0728aef0..219f35e227cc99873b3effebafc0ae9bc9926191 100644 (file)
@@ -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);
        }
index 2ace5a1751180552e224115a954615e12fc1eb1d..4bf5b6eb6448373a27ea3ee4f2215349e9a000a6 100644 (file)
@@ -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);
        }
index 49ea822a15c579273c3aaa608916c6115d079ed9..1d271b8e79a4ff5d1038186088bd3e0807a115e6 100644 (file)
@@ -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);
        }
index dd43000c25ab9322c12534faf6ea0e3923b9a331..aa3353b450f233d16c6eebb5952e448704338cbd 100644 (file)
@@ -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