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

Limin Wang lance.lmwang at gmail.com
Mon Oct 7 17:28:55 EEST 2019


On Tue, Oct 01, 2019 at 09:47:19AM +0200, Moritz Barsnick wrote:
> 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.
Thanks for the catch, I'll fix it for the update patch.


> 
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list