- static const u8 p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
- u16 i_length = p_in_buf->i_nb_samples;
- u16 * pi_length;
+ /* It is not entirely clear which endianness the AC3 stream should have.
+ * I have been told endianness does not matter, AC3 can be both endian.
+ * But then, I could not get it to work on Mac OS X and a JVC RX-6000R
+ * decoder without using little endian. So right now, I convert to little
+ * endian.
+ */
+
+ static const uint8_t p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
+#ifndef HAVE_SWAB
+ byte_t * p_tmp;
+ uint16_t i;
+#endif
+ uint16_t i_length = p_in_buf->i_nb_bytes;
+ uint8_t * pi_length;