summaryrefslogtreecommitdiff
path: root/libavfilter/af_astats.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-08-31 11:03:14 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:46 -0300
commit1f96db959c1235bb7079d354e09914a0a2608f62 (patch)
tree21ac480d5b148c0524761853e6badb3a90a7ca3f /libavfilter/af_astats.c
parent8a5896ec1f635ccf0d726f7ba7a06649ebeebf25 (diff)
avfilter: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/af_astats.c')
-rw-r--r--libavfilter/af_astats.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavfilter/af_astats.c b/libavfilter/af_astats.c
index 6c79257cb4..d59640a3fd 100644
--- a/libavfilter/af_astats.c
+++ b/libavfilter/af_astats.c
@@ -194,12 +194,12 @@ static int config_output(AVFilterLink *outlink)
{
AudioStatsContext *s = outlink->src->priv;
- s->chstats = av_calloc(sizeof(*s->chstats), outlink->channels);
+ s->chstats = av_calloc(sizeof(*s->chstats), outlink->ch_layout.nb_channels);
if (!s->chstats)
return AVERROR(ENOMEM);
s->tc_samples = FFMAX(s->time_constant * outlink->sample_rate + .5, 1);
- s->nb_channels = outlink->channels;
+ s->nb_channels = outlink->ch_layout.nb_channels;
for (int i = 0; i < s->nb_channels; i++) {
ChannelStats *p = &s->chstats[i];
@@ -584,8 +584,8 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int jobnr, int nb_job
const uint8_t * const * const data = (const uint8_t * const *)buf->extended_data;
const int channels = s->nb_channels;
const int samples = buf->nb_samples;
- 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;
switch (inlink->format) {
case AV_SAMPLE_FMT_DBLP:
@@ -638,7 +638,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
}
ff_filter_execute(ctx, filter_channel, 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->metadata)
set_metadata(s, metadata);