summaryrefslogtreecommitdiff
path: root/libavcodec/dca_core.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-05-29 08:13:23 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:41 -0300
commitb2af4bc807cfc62d61213c6050aac26ec8a1e675 (patch)
tree88e8e19480ac99f1dfcf2a618421a0bc2eef725a /libavcodec/dca_core.c
parentfa0c8a753e4851cfabf08fb558b0ca2616f27bbc (diff)
dca: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/dca_core.c')
-rw-r--r--libavcodec/dca_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c
index 80f3525b46..34b5b63159 100644
--- a/libavcodec/dca_core.c
+++ b/libavcodec/dca_core.c
@@ -2149,7 +2149,7 @@ static int filter_frame_fixed(DCACoreDecoder *s, AVFrame *frame)
nsamples, s->ch_mask);
}
- for (i = 0; i < avctx->channels; i++) {
+ for (i = 0; i < avctx->ch_layout.nb_channels; i++) {
int32_t *samples = s->output_samples[s->ch_remap[i]];
int32_t *plane = (int32_t *)frame->extended_data[i];
for (n = 0; n < nsamples; n++)
@@ -2181,11 +2181,11 @@ static int filter_frame_float(DCACoreDecoder *s, AVFrame *frame)
return ret;
// Build reverse speaker to channel mapping
- for (i = 0; i < avctx->channels; i++)
+ for (i = 0; i < avctx->ch_layout.nb_channels; i++)
output_samples[s->ch_remap[i]] = (float *)frame->extended_data[i];
// Allocate space for extra channels
- nchannels = av_popcount(s->ch_mask) - avctx->channels;
+ nchannels = av_popcount(s->ch_mask) - avctx->ch_layout.nb_channels;
if (nchannels > 0) {
av_fast_malloc(&s->output_buffer, &s->output_size,
nsamples * nchannels * sizeof(float));