-#ifdef WORDS_BIGENDIAN
- static const u8 p_sync[6] = { 0xF8, 0x72, 0x4E, 0x1F, 0x00, 0x01 };
-#else
- static const u8 p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
+ /* AC3 is natively big endian. Most SPDIF devices have the native
+ * endianness of the computer system.
+ * On Mac OS X however, little endian devices are also common.
+ */
+ static const uint8_t p_sync_le[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
+ static const uint8_t p_sync_be[6] = { 0xF8, 0x72, 0x4E, 0x1F, 0x00, 0x01 };
+#ifndef HAVE_SWAB
+ byte_t * p_tmp;
+ uint16_t i;