diff options
author | Mike Melanson <mike@multimedia.cx> | 2005-03-06 00:43:55 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2005-03-06 00:43:55 +0000 |
commit | 6d6d7970e7c0ae1bf3f0e015d3c22723ed5b1a28 (patch) | |
tree | d31dea6d1e1a23066c169eecaa91d3eb8bc279fd /libavformat/mov.c | |
parent | 2a515c08f25dc4c78c09b4600358574ef34b4ea5 (diff) | |
download | ffmpeg-6d6d7970e7c0ae1bf3f0e015d3c22723ed5b1a28.tar.gz |
first pass at ALAC decoder from David Hammerton; while David's original
decoder works great, this decoder is not completely and seamlessly
integrated yet with FFmpeg
Originally committed as revision 4008 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index afa0a23477..c0d9cec565 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -142,6 +142,7 @@ static const CodecTag mov_audio_tags[] = { { CODEC_ID_AMR_NB, MKTAG('s', 'a', 'm', 'r') }, /* AMR-NB 3gp */ { CODEC_ID_AMR_WB, MKTAG('s', 'a', 'w', 'b') }, /* AMR-WB 3gp */ { CODEC_ID_AC3, MKTAG('m', 's', 0x20, 0x00) }, /* Dolby AC-3 */ + { CODEC_ID_ALAC,MKTAG('a', 'l', 'a', 'c') }, /* Apple Lossless */ { CODEC_ID_NONE, 0 }, }; @@ -1101,6 +1102,23 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) st->codec.channels = (px[1] >> 3) & 15; } } + else if( st->codec.codec_tag == MKTAG( 'a', 'l', 'a', 'c' )) + { + /* Handle alac audio tag + special extradata */ + get_be32(pb); /* version */ + get_be32(pb); + st->codec.channels = get_be16(pb); /* channels */ + st->codec.bits_per_sample = get_be16(pb); /* bits per sample */ + get_be32(pb); + st->codec.sample_rate = get_be16(pb); + get_be16(pb); + + /* fetch the 36-byte extradata needed for alac decoding */ + st->codec.extradata_size = 36; + st->codec.extradata = (uint8_t*) + av_mallocz(st->codec.extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + get_buffer(pb, st->codec.extradata, st->codec.extradata_size); + } else if(size>=(16+20)) {//16 bytes read, reading atleast 20 more uint16_t version; |