diff options
author | Robin KAY <komadori@users.sourceforge.net> | 2002-10-05 14:39:24 +0000 |
---|---|---|
committer | Robin KAY <komadori@users.sourceforge.net> | 2002-10-05 14:39:24 +0000 |
commit | d7dfcbeb67a733508efe3029bfcf13d3ac53c033 (patch) | |
tree | c71272b312d356ef776e5f862f9fec5294bc14bc /src/demuxers/demux_aiff.c | |
parent | 6905b22fbc581c8b518853d3e2edef52f50be1a8 (diff) | |
download | xine-lib-d7dfcbeb67a733508efe3029bfcf13d3ac53c033.tar.gz xine-lib-d7dfcbeb67a733508efe3029bfcf13d3ac53c033.tar.bz2 |
Fixed segmentation faults in endian translation macros (SPARC, gcc 3.2)
CVS patchset: 2785
CVS date: 2002/10/05 14:39:24
Diffstat (limited to 'src/demuxers/demux_aiff.c')
-rw-r--r-- | src/demuxers/demux_aiff.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index 7bf2c5b8d..16300915b 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -19,7 +19,7 @@ * * AIFF File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_aiff.c,v 1.7 2002/10/03 00:08:47 tmmm Exp $ + * $Id: demux_aiff.c,v 1.8 2002/10/05 14:39:24 komadori Exp $ * */ @@ -41,8 +41,8 @@ #include "buffer.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) +#define BE_16(x) (be2me_16((uint32_t)(x))) +#define BE_32(x) (be2me_32((uint32_t)(x))) #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | \ @@ -219,8 +219,8 @@ static int load_aiff_and_send_headers(demux_aiff_t *this) { pthread_mutex_lock(&this->mutex); return DEMUX_CANNOT_HANDLE; } - chunk_type = BE_32(&preamble[0]); - chunk_size = BE_32(&preamble[4]); + chunk_type = BE_32(preamble[0]); + chunk_size = BE_32(preamble[4]); if (chunk_type == COMM_TAG) { if (this->input->read(this->input, buffer, chunk_size) != @@ -230,10 +230,10 @@ static int load_aiff_and_send_headers(demux_aiff_t *this) { return DEMUX_CANNOT_HANDLE; } - this->audio_channels = BE_16(&buffer[0]); - this->audio_frames = BE_32(&buffer[2]); - this->audio_bits = BE_16(&buffer[6]); - this->audio_sample_rate = BE_16(&buffer[0x0A]); + this->audio_channels = BE_16(buffer[0]); + this->audio_frames = BE_32(buffer[2]); + this->audio_bits = BE_16(buffer[6]); + this->audio_sample_rate = BE_16(buffer[0x0A]); this->audio_bytes_per_second = this->audio_channels * (this->audio_bits / 8) * this->audio_sample_rate; @@ -299,8 +299,8 @@ static int demux_aiff_open(demux_plugin_t *this_gen, return DEMUX_CANNOT_HANDLE; /* check the signature */ - if ((BE_32(&signature[0]) == FORM_TAG) && - (BE_32(&signature[8]) == AIFF_TAG)) + if ((BE_32(signature[0]) == FORM_TAG) && + (BE_32(signature[8]) == AIFF_TAG)) return load_aiff_and_send_headers(this); return DEMUX_CANNOT_HANDLE; |