mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/mpegaudio_parser: treat codec_id like the other parameters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d3068d25ca
commit
5669ae8401
@ -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;
|
||||
@ -82,6 +83,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user