diff options
Diffstat (limited to 'src/demuxers/demux_tta.c')
-rw-r--r-- | src/demuxers/demux_tta.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c index f6eadd652..9b2730018 100644 --- a/src/demuxers/demux_tta.c +++ b/src/demuxers/demux_tta.c @@ -30,6 +30,7 @@ #include "buffer.h" #include "bswap.h" #include "group_audio.h" +#include "attributes.h" typedef struct { demux_plugin_t demux_plugin; @@ -54,7 +55,7 @@ typedef struct { uint32_t samplerate; uint32_t data_length; uint32_t crc32; - } __attribute__((__packed__)) tta; + } XINE_PACKED tta; uint8_t buffer[22]; /* This is the size of the header */ } header; } demux_tta_t; @@ -63,16 +64,14 @@ typedef struct { demux_class_t demux_class; } demux_tta_class_t; -#define FOURCC_32(a, b, c, d) (d + (c<<8) + (b<<16) + (a<<24)) - static int open_tta_file(demux_tta_t *this) { - uint8_t peek[4]; + uint32_t peek; uint32_t framelen; - if (_x_demux_read_header(this->input, peek, 4) != 4) + if (_x_demux_read_header(this->input, &peek, 4) != 4) return 0; - if ( _X_BE_32(peek) != FOURCC_32('T', 'T', 'A', '1') ) + if ( peek != ME_FOURCC('T', 'T', 'A', '1') ) return 0; if ( this->input->read(this->input, this->header.buffer, sizeof(this->header)) != sizeof(this->header) ) @@ -87,7 +86,7 @@ static int open_tta_file(demux_tta_t *this) { return 0; } - this->seektable = xine_xmalloc(sizeof(uint32_t)*this->totalframes); + this->seektable = xine_xcalloc(this->totalframes, sizeof(uint32_t)); this->input->read(this->input, this->seektable, sizeof(uint32_t)*this->totalframes); /* Skip the CRC32 */ |