+static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
+ char *res, int res_len, int flags)
+{
+ DynamicAudioNormalizerContext *s = ctx->priv;
+ AVFilterLink *inlink = ctx->inputs[0];
+ int prev_filter_size = s->filter_size;
+ int ret;
+
+ ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
+ if (ret < 0)
+ return ret;
+
+ s->filter_size |= 1;
+ if (prev_filter_size != s->filter_size) {
+ init_gaussian_filter(s);
+
+ for (int c = 0; c < s->channels; c++) {
+ cqueue_resize(s->gain_history_original[c], s->filter_size);
+ cqueue_resize(s->gain_history_minimum[c], s->filter_size);
+ cqueue_resize(s->threshold_history[c], s->filter_size);
+ }
+ }
+
+ s->frame_len = frame_size(inlink->sample_rate, s->frame_len_msec);
+
+ return 0;
+}
+