aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/common.c
diff options
context:
space:
mode:
authorNick Kurshev <nickols_k@mail.ru>2001-07-30 09:04:34 +0000
committerNick Kurshev <nickols_k@mail.ru>2001-07-30 09:04:34 +0000
commita9b3f63084e59715da3a1dd5b365a2638aa54a1e (patch)
tree8ef3b4c9b514609ef68105dfcdf0e0ad0d519791 /libavcodec/common.c
parent3bb4e23a8aa15fc93b91b92d8c6437358fd71113 (diff)
downloadffmpeg-a9b3f63084e59715da3a1dd5b365a2638aa54a1e.tar.gz
Sync with mplayer's stuff
Originally committed as revision 14 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.c')
-rw-r--r--libavcodec/common.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/common.c b/libavcodec/common.c
index b9365c9d8d..2f54b80b3d 100644
--- a/libavcodec/common.c
+++ b/libavcodec/common.c
@@ -29,6 +29,8 @@
#define NDEBUG
#include <assert.h>
+#include "../bswap.h"
+
void init_put_bits(PutBitContext *s,
UINT8 *buffer, int buffer_size,
void *opaque,
@@ -222,10 +224,14 @@ unsigned int get_bits(GetBitContext *s, int n)
buf_ptr += 4;
/* handle common case: we can read everything */
if (buf_ptr <= s->buf_end) {
- bit_buf = (buf_ptr[-4] << 24) |
- (buf_ptr[-3] << 16) |
+#if ARCH_X86
+ bit_buf = bswap_32(*((unsigned long*)(&buf_ptr[-4])));
+#else
+ bit_buf = (buf_ptr[-4] << 24) |
+ (buf_ptr[-3] << 16) |
(buf_ptr[-2] << 8) |
- (buf_ptr[-1]);
+ (buf_ptr[-1]);
+#endif
} else {
buf_ptr -= 4;
bit_buf = 0;