summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Belokurov <kirill.belokurov@gmail.com>2008-03-28 15:52:34 +0200
committerKirill Belokurov <kirill.belokurov@gmail.com>2008-03-28 15:52:34 +0200
commitaba07be1265b56cc777c17e09cccebe1121ef697 (patch)
treef221fa24c0f08445dedac97dfc430527d0cf758e
parent30216c0016482506a11fa7f54d72d724e56fa5b3 (diff)
downloadxine-lib-aba07be1265b56cc777c17e09cccebe1121ef697.tar.gz
xine-lib-aba07be1265b56cc777c17e09cccebe1121ef697.tar.bz2
AIFF comment chunks are word-aligned, so we should seek extra byte for them
-rw-r--r--src/demuxers/demux_aiff.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c
index f520219fa..b30b74910 100644
--- a/src/demuxers/demux_aiff.c
+++ b/src/demuxers/demux_aiff.c
@@ -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 *this) {
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);
}