Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -129,17 +129,13 @@ AVFILTER_DEFINE_CLASS(dynaudnorm); · 128 unmodified lines | |||
| 129 | static av_cold int init(AVFilterContext *ctx) | 129 | static 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 | ||
| 145 | static inline int frame_size(int sample_rate, int frame_len_msec) | 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 | 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) { |