From 5cbae5651d7c1ce9b0691dfbf2d474cb2b0ebb9a Mon Sep 17 00:00:00 2001 From: Gilles Chanteperdrix Date: Fri, 13 Feb 2015 22:51:33 +0100 Subject: mpegaudio_parser: add MP3 ADU headers parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavcodec/mpegaudio_parser.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libavcodec/mpegaudio_parser.c') diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index 58ea452773..84c20d882f 100644 --- a/libavcodec/mpegaudio_parser.c +++ b/libavcodec/mpegaudio_parser.c @@ -63,6 +63,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, }else{ while(icodec_id; state= (state<<8) + buf[i++]; @@ -86,6 +87,16 @@ static int mpegaudio_parse(AVCodecParserContext *s1, avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count; } } + + if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) { + s->frame_size = 0; + next = buf_size; + } else if (codec_id == AV_CODEC_ID_MP3ADU) { + avpriv_report_missing_feature(avctx, + "MP3ADU full parser"); + return AVERROR_PATCHWELCOME; + } + break; } } @@ -106,7 +117,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, -- cgit v1.2.3