[FFmpeg-cvslog] avformat/msf: add support for ATRAC3 codec
Paul B Mahol
git at videolan.org
Thu Sep 15 18:01:28 EEST 2016
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Sep 15 16:57:48 2016 +0200| [4d677c7ae37d1df57cc79ea7577c2e4cd1de8e3a] | committer: Paul B Mahol
avformat/msf: add support for ATRAC3 codec
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4d677c7ae37d1df57cc79ea7577c2e4cd1de8e3a
---
libavformat/msf.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libavformat/msf.c b/libavformat/msf.c
index 0551e9b..24654e6 100644
--- a/libavformat/msf.c
+++ b/libavformat/msf.c
@@ -44,6 +44,7 @@ static int msf_read_header(AVFormatContext *s)
{
unsigned codec, align, size;
AVStream *st;
+ int ret;
avio_skip(s->pb, 4);
@@ -68,6 +69,17 @@ static int msf_read_header(AVFormatContext *s)
case 0: st->codecpar->codec_id = AV_CODEC_ID_PCM_S16BE; break;
case 3: st->codecpar->block_align = 16 * st->codecpar->channels;
st->codecpar->codec_id = AV_CODEC_ID_ADPCM_PSX; break;
+ case 4:
+ case 5:
+ case 6: st->codecpar->block_align = (codec == 4 ? 96 : codec == 5 ? 152 : 192) * st->codecpar->channels;
+ ret = ff_alloc_extradata(st->codecpar, 14);
+ if (ret < 0)
+ return ret;
+ memset(st->codecpar->extradata, 0, st->codecpar->extradata_size);
+ AV_WL16(st->codecpar->extradata, 1);
+ AV_WL16(st->codecpar->extradata+4, 4096);
+ AV_WL16(st->codecpar->extradata+10, 1);
+ st->codecpar->codec_id = AV_CODEC_ID_ATRAC3; break;
case 7: st->need_parsing = AVSTREAM_PARSE_FULL_RAW;
st->codecpar->codec_id = AV_CODEC_ID_MP3; break;
default:
More information about the ffmpeg-cvslog
mailing list