diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-11-03 14:27:54 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-11-03 14:27:54 +0100 |
commit | 80af00b4b23a38dd8c63b892cd103af0d9407452 (patch) | |
tree | 05090b66552d5c418a4982e436bd911fb2467487 /libavformat/cafdec.c | |
parent | 988f585fcb1cfb40fe4b706c32b31594b536bba0 (diff) | |
download | ffmpeg-80af00b4b23a38dd8c63b892cd103af0d9407452.tar.gz |
Support new ALAC magic cookie in caf files.
Diffstat (limited to 'libavformat/cafdec.c')
-rw-r--r-- | libavformat/cafdec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index 2b747ce8c4..4078f11531 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -120,6 +120,15 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size) } else if (st->codec->codec_id == CODEC_ID_ALAC) { #define ALAC_PREAMBLE 12 #define ALAC_HEADER 36 +#define ALAC_NEW_KUKI 24 + if (size == ALAC_NEW_KUKI) { + st->codec->extradata = av_mallocz(ALAC_HEADER + FF_INPUT_BUFFER_PADDING_SIZE); + if (!st->codec->extradata) + return AVERROR(ENOMEM); + strcpy(st->codec->extradata, "\0\0\0\24alac"); + avio_read(pb, st->codec->extradata + ALAC_HEADER - ALAC_NEW_KUKI, ALAC_NEW_KUKI); + st->codec->extradata_size = ALAC_HEADER; + } else { if (size < ALAC_PREAMBLE + ALAC_HEADER) { av_log(s, AV_LOG_ERROR, "invalid ALAC magic cookie\n"); avio_skip(pb, size); @@ -132,6 +141,7 @@ static int read_kuki_chunk(AVFormatContext *s, int64_t size) avio_read(pb, st->codec->extradata, ALAC_HEADER); st->codec->extradata_size = ALAC_HEADER; avio_skip(pb, size - ALAC_PREAMBLE - ALAC_HEADER); + } } else { st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); if (!st->codec->extradata) |