summaryrefslogtreecommitdiff
path: root/libavcodec/psymodel.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-05-07 07:20:32 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:39 -0300
commit494760f971a41851630d7940abe914cd1115737e (patch)
tree33e017519b761fc8e6776fdc15b5fca627d02f68 /libavcodec/psymodel.c
parent2350a50bed6bd71c67947604f117a4dff73ebe35 (diff)
downloadffmpeg-494760f971a41851630d7940abe914cd1115737e.tar.gz
aac: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/psymodel.c')
-rw-r--r--libavcodec/psymodel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/psymodel.c b/libavcodec/psymodel.c
index 93c8408297..890b13e1c8 100644
--- a/libavcodec/psymodel.c
+++ b/libavcodec/psymodel.c
@@ -35,7 +35,7 @@ av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx, int num_lens,
int i, j, k = 0;
ctx->avctx = avctx;
- ctx->ch = av_calloc(avctx->channels, 2 * sizeof(ctx->ch[0]));
+ ctx->ch = av_calloc(avctx->ch_layout.nb_channels, 2 * sizeof(ctx->ch[0]));
ctx->group = av_calloc(num_groups, sizeof(ctx->group[0]));
ctx->bands = av_malloc_array (sizeof(ctx->bands[0]), num_lens);
ctx->num_bands = av_malloc_array (sizeof(ctx->num_bands[0]), num_lens);
@@ -120,13 +120,13 @@ av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *av
FF_FILTER_MODE_LOWPASS, FILT_ORDER,
cutoff_coeff, 0.0, 0.0);
if (ctx->fcoeffs) {
- ctx->fstate = av_calloc(avctx->channels, sizeof(ctx->fstate[0]));
+ ctx->fstate = av_calloc(avctx->ch_layout.nb_channels, sizeof(ctx->fstate[0]));
if (!ctx->fstate) {
av_free(ctx->fcoeffs);
av_free(ctx);
return NULL;
}
- for (i = 0; i < avctx->channels; i++)
+ for (i = 0; i < avctx->ch_layout.nb_channels; i++)
ctx->fstate[i] = ff_iir_filter_init_state(FILT_ORDER);
}
}
@@ -154,7 +154,7 @@ av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
int i;
ff_iir_filter_free_coeffsp(&ctx->fcoeffs);
if (ctx->fstate)
- for (i = 0; i < ctx->avctx->channels; i++)
+ for (i = 0; i < ctx->avctx->ch_layout.nb_channels; i++)
ff_iir_filter_free_statep(&ctx->fstate[i]);
av_freep(&ctx->fstate);
av_free(ctx);