diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index 58ea452773ae2cc3c8f269a48862bc787f1ac112..84c20d882fb6a7af25c45843e29bf21c64e409f4 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, diff --git a/libavcodec/mpegaudiodecheader.c b/libavcodec/mpegaudiodecheader.c index 25e73195b83dffacbef0c042e8fab2583e5e5d53..8efcbe4dabe9f1d04bc324dcc28541be0c605032 100644 --- a/libavcodec/mpegaudiodecheader.c +++ b/libavcodec/mpegaudiodecheader.c @@ -134,7 +134,8 @@ int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_r break; default: case 3: - avctx->codec_id = AV_CODEC_ID_MP3; + if (avctx->codec_id != AV_CODEC_ID_MP3ADU) + avctx->codec_id = AV_CODEC_ID_MP3; if (s->lsf) *frame_size = 576; else diff --git a/libavcodec/version.h b/libavcodec/version.h index ca9d1bca8f6a0c171b4a68f69e2a0757ff50fb29..4890f46ce6b77e50cdb5a51bd6e79735c8a9dcec 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 56 -#define LIBAVCODEC_VERSION_MINOR 15 +#define LIBAVCODEC_VERSION_MINOR 16 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \