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