diff options
author | Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> | 2015-02-13 22:51:33 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-14 19:32:42 +0100 |
commit | 8ca098f4445cd12d39b2c55b0dfb8c988b7b28ce (patch) | |
tree | 34afa9f2561cc4a7534ddc2bd66be18ad0ffded7 /libavcodec/mpegaudio_parser.c | |
parent | b533949813cc8eaa2eb68142b0fa384c231ab6c9 (diff) |
avcocdec/mpegaudio_parser: add MP3 ADU headers parser
Reviewed-by: Thomas Volkert <silvo@gmx.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegaudio_parser.c')
-rw-r--r-- | libavcodec/mpegaudio_parser.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index 79dbf635b4..42f470685a 100644 --- a/libavcodec/mpegaudio_parser.c +++ b/libavcodec/mpegaudio_parser.c @@ -64,7 +64,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, }else{ while(i<buf_size){ int ret, sr, channels, bit_rate, frame_size; - enum AVCodecID codec_id; + enum AVCodecID codec_id = avctx->codec_id; state= (state<<8) + buf[i++]; @@ -90,6 +90,16 @@ static int mpegaudio_parse(AVCodecParserContext *s1, avctx->bit_rate += (bit_rate - avctx->bit_rate) / (s->header_count - header_threshold); } } + + if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) { + s->frame_size = 0; + next = buf_size; + } else if (codec_id == AV_CODEC_ID_MP3ADU) { + av_log(avctx, AV_LOG_ERROR, + "MP3ADU full parser not implemented"); + return AVERROR_PATCHWELCOME; + } + break; } } @@ -110,7 +120,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, AVCodecParser ff_mpegaudio_parser = { - .codec_ids = { AV_CODEC_ID_MP1, AV_CODEC_ID_MP2, AV_CODEC_ID_MP3 }, + .codec_ids = { AV_CODEC_ID_MP1, AV_CODEC_ID_MP2, AV_CODEC_ID_MP3, AV_CODEC_ID_MP3ADU }, .priv_data_size = sizeof(MpegAudioParseContext), .parser_parse = mpegaudio_parse, .parser_close = ff_parse_close, |