mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/adxdec: set avctx->channels in adx_read_header
It is used in adx_read_packet, which currently depends on the decoder/parser setting this value between reading the file header and demuxing the first packet.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 64ea4a0598
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
20655dd2ec
commit
72f83ad277
|
@ -83,8 +83,14 @@ static int adx_read_header(AVFormatContext *s)
|
||||||
av_log(s, AV_LOG_ERROR, "Invalid extradata size.\n");
|
av_log(s, AV_LOG_ERROR, "Invalid extradata size.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
avctx->channels = AV_RB8(avctx->extradata + 7);
|
||||||
avctx->sample_rate = AV_RB32(avctx->extradata + 8);
|
avctx->sample_rate = AV_RB32(avctx->extradata + 8);
|
||||||
|
|
||||||
|
if (avctx->channels <= 0) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", avctx->channels);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||||
st->codec->codec_id = s->iformat->raw_codec_id;
|
st->codec->codec_id = s->iformat->raw_codec_id;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue