diff options
author | jkeil <jkeil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-07 16:43:04 +0000 |
---|---|---|
committer | jkeil <jkeil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-07 16:43:04 +0000 |
commit | d260d605ec8834a7fb2e5cc8a5248119ae1a14d6 (patch) | |
tree | b00260a62758434574aa26bb8e7be877edb09421 /libmpdemux | |
parent | 23c044e4dfd974cea015dbd7cbd9ec8c2e34a423 (diff) | |
download | mpv-d260d605ec8834a7fb2e5cc8a5248119ae1a14d6.tar.bz2 mpv-d260d605ec8834a7fb2e5cc8a5248119ae1a14d6.tar.xz |
BE_16/BE_32 macro was accessing integers from unaligned addresses on SPARC
char2short/char2int broken on BIGENDIAN
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7655 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_mov.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c index e81acec38e..0623809221 100644 --- a/libmpdemux/demux_mov.c +++ b/libmpdemux/demux_mov.c @@ -47,17 +47,15 @@ #include <fcntl.h> #endif -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - -#ifndef WORDS_BIGENDIAN -#define char2short(x,y) ((x[y]<<8)|x[y+1]) -#define char2int(x,y) ((x[y]<<24)|(x[y+1]<<16)|(x[y+2]<<8)|x[y+3]) -#else -#warning Check the implementation of char2short and char2int on BIGENDIAN!!! -#define char2short(x,y) (x[y]|(x[y+1]<<8)) -#define char2int(x,y) (x[y]|(x[y+1]<<8)|(x[y+2]<<16)|(x[y+3]<<24)) -#endif +#define BE_16(x) (((unsigned char *)(x))[0] << 8 | \ + ((unsigned char *)(x))[1]) +#define BE_32(x) (((unsigned char *)(x))[0] << 24 | \ + ((unsigned char *)(x))[1] << 16 | \ + ((unsigned char *)(x))[2] << 8 | \ + ((unsigned char *)(x))[3]) + +#define char2short(x,y) BE_16(&(x)[(y)]) +#define char2int(x,y) BE_32(&(x)[(y)]) typedef struct { unsigned int pts; // duration |