diff options
author | James Almer <jamrial@gmail.com> | 2012-11-29 20:14:50 +0400 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-12-04 15:25:46 +0400 |
commit | b70251c0adcc256899217798ac744b440d41d237 (patch) | |
tree | 0e845fc0ef727d04e978d4b12db834d3d04b75ce /libavformat/astdec.c | |
parent | 7f0e7fc9e2e668a535dec5a5c70aa95c7788700c (diff) |
AST Muxer
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/astdec.c')
-rw-r--r-- | libavformat/astdec.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/libavformat/astdec.c b/libavformat/astdec.c index 5f69f47d44..fb5a34fddd 100644 --- a/libavformat/astdec.c +++ b/libavformat/astdec.c @@ -23,6 +23,7 @@ #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" +#include "ast.h" static int ast_probe(AVProbeData *p) { @@ -36,7 +37,7 @@ static int ast_probe(AVProbeData *p) static int ast_read_header(AVFormatContext *s) { - int codec, depth; + int depth; AVStream *st; st = avformat_new_stream(s, NULL); @@ -44,17 +45,8 @@ static int ast_read_header(AVFormatContext *s) return AVERROR(ENOMEM); avio_skip(s->pb, 8); - codec = avio_rb16(s->pb); - switch (codec) { - case 0: - st->codec->codec_id = AV_CODEC_ID_ADPCM_AFC; - break; - case 1: - st->codec->codec_id = AV_CODEC_ID_PCM_S16BE_PLANAR; - break; - default: - av_log(s, AV_LOG_ERROR, "unsupported codec %d\n", codec); - } + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codec->codec_id = ff_codec_get_id(ff_codec_ast_tags, avio_rb16(s->pb)); depth = avio_rb16(s->pb); if (depth != 16) { @@ -62,7 +54,6 @@ static int ast_read_header(AVFormatContext *s) return AVERROR_INVALIDDATA; } - st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->channels = avio_rb16(s->pb); if (!st->codec->channels) return AVERROR_INVALIDDATA; @@ -124,4 +115,5 @@ AVInputFormat ff_ast_demuxer = { .read_packet = ast_read_packet, .extensions = "ast", .flags = AVFMT_GENERIC_INDEX, + .codec_tag = (const AVCodecTag* const []){ff_codec_ast_tags, 0}, }; |