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
129static av_cold int init(AVFilterContext *ctx)129static av_cold int init(AVFilterContext *ctx)
130{130{
131 DynamicAudioNormalizerContext *s = ctx->priv;131 DynamicAudioNormalizerContext *s = ctx->priv;
132 int ret = 0;
133 132
134 if (!(s->filter_size & 1)) {133 if (!(s->filter_size & 1)) {
135 av_log(ctx, AV_LOG_WARNING, "filter size %d is invalid. Changing to an odd value.\n", s->filter_size);134 av_log(ctx, AV_LOG_WARNING, "filter size %d is invalid. Changing to an odd value.\n", s->filter_size);
136 s->filter_size |= 1;135 s->filter_size |= 1;
137 }136 }
138 137
139 if (strcmp(s->channels_to_filter, "all"))138 return 0;
140 ret = av_channel_layout_from_string(&s->ch_layout, s->channels_to_filter);
141
142 return ret;
143}139}
144 140
145static inline int frame_size(int sample_rate, int frame_len_msec)141static inline int frame_size(int sample_rate, int frame_len_msec)
@@ -852,6 +848,12 @@ static int activate(AVFilterContext *ctx) · 706 unmodified lines
852 int ret = 0, status;848 int ret = 0, status;
853 int64_t pts;849 int64_t pts;
854 850
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
855 FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);857 FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
856 858
857 if (!s->eof) {859 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