[FFmpeg-cvslog] avfilter/af_dynaudnorm: fix regression with channels option processing

Paul B Mahol git at videolan.org
Tue Mar 15 17:11:32 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Mar 15 15:40:00 2022 +0100| [9f81d12f87ef024b8ff7ce9c5eed4a6c211d62db] | committer: Paul B Mahol

avfilter/af_dynaudnorm: fix regression with channels option processing

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f81d12f87ef024b8ff7ce9c5eed4a6c211d62db
---

 libavfilter/af_dynaudnorm.c | 12 +++++++-----
 1 file 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) {



More information about the ffmpeg-cvslog mailing list