From 7c6eebf42347b3ed20a66dce2e26fbfbec4ca647 Mon Sep 17 00:00:00 2001 From: Jian Wang Date: Thu, 25 May 2017 07:07:28 +0000 Subject: PD#144784: fix mp2 in mov parsed mp3 Change-Id: Id257d803322d382f973b0f0590a80b90b91ed8a1 --- diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index 8c39825..021cba4 100644 --- a/libavcodec/mpegaudio_parser.c +++ b/libavcodec/mpegaudio_parser.c @@ -91,6 +91,9 @@ static int mpegaudio_parse(AVCodecParserContext *s1, avctx->bit_rate += (bit_rate - avctx->bit_rate) / (s->header_count - header_threshold); } } + if (avctx->codec_id == AV_CODEC_ID_MP3 && codec_id == AV_CODEC_ID_MP2) { + avctx->codec_id = AV_CODEC_ID_MP2; + } if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) { s->frame_size = 0; diff --git a/libavformat/mov.c b/libavformat/mov.c index 0e04375..7730833 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2190,6 +2190,7 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb, case AV_CODEC_ID_MP3: /* force type after stsd for m1a hdlr */ st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; + st->need_parsing = AVSTREAM_PARSE_FULL; break; case AV_CODEC_ID_GSM: case AV_CODEC_ID_ADPCM_MS: -- cgit