diff options
author | James Almer <jamrial@gmail.com> | 2021-08-31 17:03:14 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 15:42:46 +0300 |
commit | 1f96db959c1235bb7079d354e09914a0a2608f62 (patch) | |
tree | 21ac480d5b148c0524761853e6badb3a90a7ca3f /libavfilter/af_anequalizer.c | |
parent | 8a5896ec1f635ccf0d726f7ba7a06649ebeebf25 (diff) |
avfilter: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/af_anequalizer.c')
-rw-r--r-- | libavfilter/af_anequalizer.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavfilter/af_anequalizer.c b/libavfilter/af_anequalizer.c index 57a9b7634b..c7b9a83d99 100644 --- a/libavfilter/af_anequalizer.c +++ b/libavfilter/af_anequalizer.c @@ -103,7 +103,7 @@ static void draw_curves(AVFilterContext *ctx, AVFilterLink *inlink, AVFrame *out memset(out->data[0], 0, s->h * out->linesize[0]); - for (ch = 0; ch < inlink->channels; ch++) { + for (ch = 0; ch < inlink->ch_layout.nb_channels; ch++) { uint8_t fg[4] = { 0xff, 0xff, 0xff, 0xff }; int prev_v = -1; double f; @@ -577,8 +577,8 @@ static int config_input(AVFilterLink *inlink) if (!args) return AVERROR(ENOMEM); - s->nb_allocated = 32 * inlink->channels; - s->filters = av_calloc(inlink->channels, 32 * sizeof(*s->filters)); + s->nb_allocated = 32 * inlink->ch_layout.nb_channels; + s->filters = av_calloc(inlink->ch_layout.nb_channels, 32 * sizeof(*s->filters)); if (!s->filters) { s->nb_allocated = 0; av_free(args); @@ -610,7 +610,7 @@ static int config_input(AVFilterLink *inlink) s->filters[s->nb_filters].ignore = 1; if (s->filters[s->nb_filters].channel < 0 || - s->filters[s->nb_filters].channel >= inlink->channels) + s->filters[s->nb_filters].channel >= inlink->ch_layout.nb_channels) s->filters[s->nb_filters].ignore = 1; s->filters[s->nb_filters].type = av_clip(s->filters[s->nb_filters].type, 0, NB_TYPES - 1); @@ -698,8 +698,8 @@ static int filter_channels(AVFilterContext *ctx, void *arg, { AudioNEqualizerContext *s = ctx->priv; AVFrame *buf = arg; - const int start = (buf->channels * jobnr) / nb_jobs; - const int end = (buf->channels * (jobnr+1)) / nb_jobs; + const int start = (buf->ch_layout.nb_channels * jobnr) / nb_jobs; + const int end = (buf->ch_layout.nb_channels * (jobnr+1)) / nb_jobs; for (int i = 0; i < s->nb_filters; i++) { EqualizatorFilter *f = &s->filters[i]; @@ -731,7 +731,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) if (!ctx->is_disabled) ff_filter_execute(ctx, filter_channels, buf, NULL, - FFMIN(inlink->channels, ff_filter_get_nb_threads(ctx))); + FFMIN(inlink->ch_layout.nb_channels, ff_filter_get_nb_threads(ctx))); if (s->draw_curves) { AVFrame *clone; |