diff options
Diffstat (limited to 'chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c')
-rw-r--r-- | chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c b/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c index 408193671fe..3d9e94688a7 100644 --- a/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c +++ b/chromium/third_party/ffmpeg/libavcodec/mpegaudio_parser.c @@ -64,10 +64,11 @@ static int mpegaudio_parse(AVCodecParserContext *s1, }else{ while(i<buf_size){ int ret, sr, channels, bit_rate, frame_size; + enum AVCodecID codec_id; state= (state<<8) + buf[i++]; - ret = avpriv_mpa_decode_header(avctx, state, &sr, &channels, &frame_size, &bit_rate); + ret = avpriv_mpa_decode_header2(state, &sr, &channels, &frame_size, &bit_rate, &codec_id); if (ret < 4) { if (i > 4) s->header_count = -2; @@ -78,10 +79,11 @@ 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; + avctx->codec_id = codec_id; if (s->no_bitrate || !avctx->bit_rate) { s->no_bitrate = 1; avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count; |