diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-03-15 15:40:00 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-03-15 16:07:57 +0100 |
commit | 9f81d12f87ef024b8ff7ce9c5eed4a6c211d62db (patch) | |
tree | 6983f220095dd6b9ba53e05b131c019e77af3947 /libavfilter/af_dynaudnorm.c | |
parent | 07c16cdd949dacbf9efa153a0748da88d63198f0 (diff) | |
download | ffmpeg-9f81d12f87ef024b8ff7ce9c5eed4a6c211d62db.tar.gz |
avfilter/af_dynaudnorm: fix regression with channels option processing
Diffstat (limited to 'libavfilter/af_dynaudnorm.c')
-rw-r--r-- | libavfilter/af_dynaudnorm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c index b46420d291..4fe1a9ce1b 100644 --- a/libavfilter/af_dynaudnorm.c +++ b/libavfilter/af_dynaudnorm.c @@ -129,17 +129,13 @@ AVFILTER_DEFINE_CLASS(dynaudnorm); static av_cold int init(AVFilterContext *ctx) { DynamicAudioNormalizerContext *s = ctx->priv; - int ret = 0; if (!(s->filter_size & 1)) { av_log(ctx, AV_LOG_WARNING, "filter size %d is invalid. Changing to an odd value.\n", s->filter_size); s->filter_size |= 1; } - if (strcmp(s->channels_to_filter, "all")) - ret = av_channel_layout_from_string(&s->ch_layout, s->channels_to_filter); - - return ret; + return 0; } static inline int frame_size(int sample_rate, int frame_len_msec) @@ -852,6 +848,12 @@ static int activate(AVFilterContext *ctx) int ret = 0, status; int64_t pts; + ret = av_channel_layout_copy(&s->ch_layout, &inlink->ch_layout); + if (ret < 0) + return ret; + if (strcmp(s->channels_to_filter, "all")) + av_channel_layout_from_string(&s->ch_layout, s->channels_to_filter); + FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); if (!s->eof) { |