diff options
author | James Almer <jamrial@gmail.com> | 2015-11-19 16:00:16 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2015-11-19 16:00:16 -0300 |
commit | 01c63e69f174eae394cf8541e7b19e8c8886fbb9 (patch) | |
tree | b0d3031f249e70b2a240077a9e5bfe3df73e9ea8 /libavformat/rsd.c | |
parent | 3d2363fbf9fa185da349be09e0189abd99e735fe (diff) | |
download | ffmpeg-01c63e69f174eae394cf8541e7b19e8c8886fbb9.tar.gz |
avformat/rsd: GADP files are adpcm_thp_le
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/rsd.c')
-rw-r--r-- | libavformat/rsd.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libavformat/rsd.c b/libavformat/rsd.c index 01a27f9493..8cef7f5850 100644 --- a/libavformat/rsd.c +++ b/libavformat/rsd.c @@ -27,7 +27,7 @@ static const AVCodecTag rsd_tags[] = { { AV_CODEC_ID_ADPCM_PSX, MKTAG('V','A','G',' ') }, - { AV_CODEC_ID_ADPCM_THP, MKTAG('G','A','D','P') }, + { AV_CODEC_ID_ADPCM_THP_LE, MKTAG('G','A','D','P') }, { AV_CODEC_ID_ADPCM_THP, MKTAG('W','A','D','P') }, { AV_CODEC_ID_ADPCM_IMA_RAD, MKTAG('R','A','D','P') }, { AV_CODEC_ID_ADPCM_IMA_WAV, MKTAG('X','A','D','P') }, @@ -121,8 +121,7 @@ static int rsd_read_header(AVFormatContext *s) if (pb->seekable) st->duration = av_get_audio_frame_duration(codec, avio_size(pb) - start); break; - case AV_CODEC_ID_ADPCM_THP: - if (st->codec->codec_tag == MKTAG('G','A','D','P')) { + case AV_CODEC_ID_ADPCM_THP_LE: /* RSD3GADP is mono, so only alloc enough memory to store the coeff table for a single channel. */ @@ -130,11 +129,10 @@ static int rsd_read_header(AVFormatContext *s) if ((ret = ff_get_extradata(codec, s->pb, 32)) < 0) return ret; - - for (i = 0; i < 16; i++) - AV_WB16(codec->extradata + i * 2, AV_RL16(codec->extradata + i * 2)); - - } else { + if (pb->seekable) + st->duration = av_get_audio_frame_duration(codec, avio_size(pb) - start); + break; + case AV_CODEC_ID_ADPCM_THP: codec->block_align = 8 * codec->channels; avio_skip(s->pb, 0x1A4 - avio_tell(s->pb)); @@ -145,7 +143,6 @@ static int rsd_read_header(AVFormatContext *s) avio_read(s->pb, st->codec->extradata + 32 * i, 32); avio_skip(s->pb, 8); } - } if (pb->seekable) st->duration = (avio_size(pb) - start) / (8 * st->codec->channels) * 14; break; |