diff options
author | James Almer <jamrial@gmail.com> | 2021-08-31 11:03:14 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:46 -0300 |
commit | 1f96db959c1235bb7079d354e09914a0a2608f62 (patch) | |
tree | 21ac480d5b148c0524761853e6badb3a90a7ca3f /libavfilter/af_mcompand.c | |
parent | 8a5896ec1f635ccf0d726f7ba7a06649ebeebf25 (diff) | |
download | ffmpeg-1f96db959c1235bb7079d354e09914a0a2608f62.tar.gz |
avfilter: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/af_mcompand.c')
-rw-r--r-- | libavfilter/af_mcompand.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavfilter/af_mcompand.c b/libavfilter/af_mcompand.c index 90cfda38c9..1267cd9f34 100644 --- a/libavfilter/af_mcompand.c +++ b/libavfilter/af_mcompand.c @@ -302,7 +302,7 @@ static int crossover_setup(AVFilterLink *outlink, Crossover *p, double frequency square_quadratic(x + 3, p->coefs + 5); square_quadratic(x + 6, p->coefs + 10); - p->previous = av_calloc(outlink->channels, sizeof(*p->previous)); + p->previous = av_calloc(outlink->ch_layout.nb_channels, sizeof(*p->previous)); if (!p->previous) return AVERROR(ENOMEM); @@ -350,13 +350,13 @@ static int config_output(AVFilterLink *outlink) return AVERROR(EINVAL); } - s->bands[i].attack_rate = av_calloc(outlink->channels, sizeof(double)); - s->bands[i].decay_rate = av_calloc(outlink->channels, sizeof(double)); - s->bands[i].volume = av_calloc(outlink->channels, sizeof(double)); + s->bands[i].attack_rate = av_calloc(outlink->ch_layout.nb_channels, sizeof(double)); + s->bands[i].decay_rate = av_calloc(outlink->ch_layout.nb_channels, sizeof(double)); + s->bands[i].volume = av_calloc(outlink->ch_layout.nb_channels, sizeof(double)); if (!s->bands[i].attack_rate || !s->bands[i].decay_rate || !s->bands[i].volume) return AVERROR(ENOMEM); - for (k = 0; k < FFMIN(nb_attacks / 2, outlink->channels); k++) { + for (k = 0; k < FFMIN(nb_attacks / 2, outlink->ch_layout.nb_channels); k++) { char *tstr3 = av_strtok(p3, ",", &saveptr3); p3 = NULL; @@ -377,7 +377,7 @@ static int config_output(AVFilterLink *outlink) } } - for (ch = k; ch < outlink->channels; ch++) { + for (ch = k; ch < outlink->ch_layout.nb_channels; ch++) { s->bands[i].attack_rate[ch] = s->bands[i].attack_rate[k - 1]; s->bands[i].decay_rate[ch] = s->bands[i].decay_rate[k - 1]; } @@ -440,7 +440,7 @@ static int config_output(AVFilterLink *outlink) sscanf(tstr2, "%lf", &initial_volume); initial_volume = pow(10.0, initial_volume / 20); - for (k = 0; k < outlink->channels; k++) { + for (k = 0; k < outlink->ch_layout.nb_channels; k++) { s->bands[i].volume[k] = initial_volume; } @@ -574,7 +574,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) s->band_samples = in->nb_samples; } - for (ch = 0; ch < outlink->channels; ch++) { + for (ch = 0; ch < outlink->ch_layout.nb_channels; ch++) { double *a, *dst = (double *)out->extended_data[ch]; for (band = 0, abuf = in, bbuf = s->band_buf2, cbuf = s->band_buf1; band < s->nb_bands; band++) { |