diff options
author | Benjamin Larsson <banan@ludd.ltu.se> | 2007-04-17 20:53:39 +0000 |
---|---|---|
committer | Benjamin Larsson <banan@ludd.ltu.se> | 2007-04-17 20:53:39 +0000 |
commit | 10e26bc782b512e275fe860f2c8330b0b9277410 (patch) | |
tree | eb46ef092348512baf50821be8e775e40f7a0ba6 /libavformat | |
parent | 935f50c82cb80e40fa9e6f587af04b428b4aae0d (diff) | |
download | ffmpeg-10e26bc782b512e275fe860f2c8330b0b9277410.tar.gz |
Atrac3 decoder.
Originally committed as revision 8747 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/riff.c | 1 | ||||
-rw-r--r-- | libavformat/rm.c | 9 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c index 4a5553fa41..0f5e975692 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -204,6 +204,7 @@ const AVCodecTag codec_wav_tags[] = { { CODEC_ID_FLAC, 0xF1AC }, { CODEC_ID_IMC, 0x401 }, { CODEC_ID_GSM_MS, 0x31 }, + { CODEC_ID_ATRAC3, 0x270 }, /* FIXME: All of the IDs below are not 16 bit and thus illegal. */ // for NuppelVideo (nuv.c) diff --git a/libavformat/rm.c b/libavformat/rm.c index d2e41acbb6..96752f225f 100644 --- a/libavformat/rm.c +++ b/libavformat/rm.c @@ -565,7 +565,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVStream *st, } rm->audiobuf = av_malloc(rm->audio_framesize * sub_packet_h); - } else if (!strcmp(buf, "cook")) { + } else if ((!strcmp(buf, "cook")) || (!strcmp(buf, "atrc"))) { int codecdata_length, i; get_be16(pb); get_byte(pb); if (((version >> 16) & 0xff) == 5) @@ -576,7 +576,8 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVStream *st, return -1; } - st->codec->codec_id = CODEC_ID_COOK; + if (!strcmp(buf, "cook")) st->codec->codec_id = CODEC_ID_COOK; + else st->codec->codec_id = CODEC_ID_ATRAC3; st->codec->extradata_size= codecdata_length; st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); for(i = 0; i < codecdata_length; i++) @@ -957,7 +958,8 @@ resync: } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { if ((st->codec->codec_id == CODEC_ID_RA_288) || - (st->codec->codec_id == CODEC_ID_COOK)) { + (st->codec->codec_id == CODEC_ID_COOK) || + (st->codec->codec_id == CODEC_ID_ATRAC3)) { int x; int sps = rm->sub_packet_size; int cfs = rm->coded_framesize; @@ -975,6 +977,7 @@ resync: for (x = 0; x < h/2; x++) get_buffer(pb, rm->audiobuf+x*2*w+y*cfs, cfs); break; + case CODEC_ID_ATRAC3: case CODEC_ID_COOK: for (x = 0; x < w/sps; x++) get_buffer(pb, rm->audiobuf+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), sps); |