History

avfilter/af_dynaudnorm: fix regression with channels option processing

Paul B Mahol committed 4 years ago

Commit 9f81d121 parent 07c16cd1 file · +7 −5Browse files

Unified · Split

libavfilter/af_dynaudnorm.c+7−5
@@ -129,17 +129,13 @@ AVFILTER_DEFINE_CLASS(dynaudnorm); · 128 unmodified lines
129129 static av_cold int init(AVFilterContext *ctx)
130130 {
131131 DynamicAudioNormalizerContext *s = ctx->priv;
132− int ret = 0;
133132
134133 if (!(s->filter_size & 1)) {
135134 av_log(ctx, AV_LOG_WARNING, "filter size %d is invalid. Changing to an odd value.\n", s->filter_size);
136135 s->filter_size |= 1;
137136 }
138137
139− if (strcmp(s->channels_to_filter, "all"))
140− ret = av_channel_layout_from_string(&s->ch_layout, s->channels_to_filter);
141−
142− return ret;
138+ return 0;
143139 }
144140
145141 static inline int frame_size(int sample_rate, int frame_len_msec)
@@ -852,6 +848,12 @@ static int activate(AVFilterContext *ctx) · 706 unmodified lines
852848 int ret = 0, status;
853849 int64_t pts;
854850
851+ ret = av_channel_layout_copy(&s->ch_layout, &inlink->ch_layout);
852+ if (ret < 0)
853+ return ret;
854+ if (strcmp(s->channels_to_filter, "all"))
855+ av_channel_layout_from_string(&s->ch_layout, s->channels_to_filter);
856+
855857 FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
856858
857859 if (!s->eof) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t