summaryrefslogtreecommitdiff
path: root/src/libac3
diff options
context:
space:
mode:
Diffstat (limited to 'src/libac3')
-rw-r--r--src/libac3/bitstream.c10
-rw-r--r--src/libac3/bitstream.h5
2 files changed, 15 insertions, 0 deletions
diff --git a/src/libac3/bitstream.c b/src/libac3/bitstream.c
index 8d771965e..1f4aff54e 100644
--- a/src/libac3/bitstream.c
+++ b/src/libac3/bitstream.c
@@ -44,8 +44,18 @@ void bitstream_set_ptr (uint8_t * buf)
static inline void
bitstream_fill_current()
{
+#ifdef __sparc__
+#warning FIXME: cannot access unaligned pointer on sparc
+ current_word =
+ (buffer_start[0] << 24) |
+ (buffer_start[1] << 16) |
+ (buffer_start[2] << 8) |
+ buffer_start[3];
+ buffer_start += 4;
+#else
current_word = *((uint32_t*)buffer_start)++;
current_word = swab32(current_word);
+#endif
}
//
diff --git a/src/libac3/bitstream.h b/src/libac3/bitstream.h
index 84f3287c8..b5d896184 100644
--- a/src/libac3/bitstream.h
+++ b/src/libac3/bitstream.h
@@ -21,6 +21,11 @@
*
*/
+#warning FIXME: need WORDS_BIGENDIAN autoconf test
+#ifdef __sparc__
+#define WORDS_BIGENDIAN 1
+#endif
+
//My new and improved vego-matic endian swapping routine
//(stolen from the kernel)
#ifdef WORDS_BIGENDIAN