From c33351f3e75d13803f8e19676304b405711d38ea Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 12 Feb 2014 00:11:16 +0100 Subject: avcodec/mpegaudio_parser: Delay setting codec_id if it appears wrong Fixes mp1/mp3 in mp4 misdetection Signed-off-by: Michael Niedermayer --- libavcodec/mpegaudio_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/mpegaudio_parser.c') diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index 7a6411ca63..3d9e94688a 100644 --- a/libavcodec/mpegaudio_parser.c +++ b/libavcodec/mpegaudio_parser.c @@ -79,7 +79,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, s->header_count++; s->frame_size = ret-4; - if (s->header_count > 0) { + if (s->header_count > 0 + (avctx->codec_id != AV_CODEC_ID_NONE && avctx->codec_id != codec_id)) { avctx->sample_rate= sr; avctx->channels = channels; s1->duration = frame_size; -- cgit v1.2.3