summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-05-29 09:36:27 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:42 -0300
commitdd544b5ef0f4d4bd2f235e8bfc1d6526df759613 (patch)
tree5e2a5a2ad7b5a43531d2856e3a580be828eb7898 /libavcodec
parent2c15e1975a75cf9556fd66d23f01ca3faf94772a (diff)
interplayacm: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/interplayacm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/interplayacm.c b/libavcodec/interplayacm.c
index c11178a9ee..7b4e539239 100644
--- a/libavcodec/interplayacm.c
+++ b/libavcodec/interplayacm.c
@@ -79,12 +79,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (avctx->extradata_size < 14)
return AVERROR_INVALIDDATA;
- if (avctx->channels <= 0) {
- av_log(avctx, AV_LOG_ERROR, "Invalid number of channels: %d\n", avctx->channels);
+ if (avctx->ch_layout.nb_channels <= 0) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of channels: %d\n", avctx->ch_layout.nb_channels);
return AVERROR_INVALIDDATA;
}
- s->max_samples = AV_RL32(avctx->extradata + 4) / avctx->channels;
+ s->max_samples = AV_RL32(avctx->extradata + 4) / avctx->ch_layout.nb_channels;
if (s->max_samples == 0)
s->max_samples = UINT64_MAX;
s->level = AV_RL16(avctx->extradata + 12) & 0xf;
@@ -585,7 +585,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if ((ret = init_get_bits8(gb, buf, buf_size)) < 0)
return ret;
- frame->nb_samples = FFMIN(s->block_len / avctx->channels, s->max_samples);
+ frame->nb_samples = FFMIN(s->block_len / avctx->ch_layout.nb_channels, s->max_samples);
s->max_samples -= FFMIN(frame->nb_samples, s->max_samples);
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
@@ -596,7 +596,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return ret;
samples = (int16_t *)frame->data[0];
- for (n = 0; n < frame->nb_samples * avctx->channels; n++) {
+ for (n = 0; n < frame->nb_samples * avctx->ch_layout.nb_channels; n++) {
int val = s->block[n] >> s->level;
*samples++ = val;
}