[FFmpeg-devel] [PATCH v1] avfilter/vf_freezedetect: add force_discard option to force discard freeze/non-freeze frame

Moritz Barsnick barsnick at gmx.net
Tue Oct 1 10:47:19 EEST 2019


On Mon, Sep 30, 2019 at 23:22:18 +0800, lance.lmwang at gmail.com wrote:
> +                if ( s->force_discard > 0 && frozen)
> +                    s->drop_count++;
> +                else if ( s->force_discard < 0 && frozen && s->drop_count < 0) {
> +                    s->drop_count = 0;
> +                }

"if (s" (drop the space after the opening bracket).

I also don't quite understand why you use no brackets around the if()
block, but around the else block.

> +            if (s->force_discard > 0) {
> +                s->drop_count = 0;
> +            } else if ( s->force_discard < 0)
> +                s->drop_count--;

Same here regarding the brackets. Quite confusing, both blocks are
one-liners.

> -        return ff_filter_frame(outlink, frame);
> +        if (s->drop_count > 0 || s->drop_count < 0) {
> +            av_frame_free(&frame);
> +        } else
> +            return ff_filter_frame(outlink, frame);

Same here.

Moritz


More information about the ffmpeg-devel mailing list