From: Kirill B. <kir...@gm...> - 2008-03-28 23:01:34
|
# HG changeset patch # User Kirill Belokurov <kir...@gm...> # Date 1206712354 -7200 # Node ID dafd0b0f5e76abcf8ce895f252a5f707b3e7fa42 # Parent 00f5ca5a7e57600941ccab085f213675d272c260 AIFF comment chunks are word-aligned, so we should seek extra byte for them diff -r dafd0b0f5e76abcf8ce895f252a5f707b3e7fa42 -r 00f5ca5a7e57600941ccab085f213675d272c260 src/demuxers/demux_aiff.c --- a/src/demuxers/demux_aiff.c Fri Mar 28 15:52:34 2008 +0200 +++ b/src/demuxers/demux_aiff.c Thu Mar 27 17:27:12 2008 +0200 @@ -46,6 +46,10 @@ #define COMM_TAG FOURCC_TAG('C', 'O', 'M', 'M') #define SSND_TAG FOURCC_TAG('S', 'S', 'N', 'D') #define APCM_TAG FOURCC_TAG('A', 'P', 'C', 'M') +#define NAME_TAG FOURCC_TAG('N', 'A', 'M', 'E') +#define AUTH_TAG FOURCC_TAG('A', 'U', 'T', 'H') +#define COPY_TAG FOURCC_TAG('(', 'c', ')', ' ') +#define ANNO_TAG FOURCC_TAG('A', 'N', 'N', 'O') #define PREAMBLE_SIZE 8 #define AIFF_SIGNATURE_SIZE 12 @@ -157,6 +161,11 @@ static int open_aiff_file(demux_aiff_t * break; } else { + /* if chunk contains metadata, it will be word-aligned (as seen at sox and ffmpeg) */ + if ( ((chunk_type == NAME_TAG) || (chunk_type==AUTH_TAG) || + (chunk_type == COPY_TAG) || (chunk_type==ANNO_TAG)) && (chunk_size&1)) + chunk_size++; + /* unrecognized; skip it */ this->input->seek(this->input, chunk_size, SEEK_CUR); } |