[FFmpeg-devel] [PATCH] avfilter/vf_xcam: add xcam video filter

Alexander Strasser eclipse7 at gmx.net
Thu Jul 30 22:08:16 EEST 2020


Hi!

On 2020-07-30 12:16 +0000, Zane van Iperen wrote:
> On Fri, 31 Jul 2020 00:55:56 +0800
> "zongwave" <wei.zong at intel.com> wrote:
[...]
>
> > ++static av_cold int xcam_init(AVFilterContext *ctx)
> > ++{
> > ++    XCAMContext *s = ctx->priv;
> > ++    int ret = 0;
> > ++
> > ++    s->handle = xcam_create_handle(s->name);
> > ++    if (!s->handle) {
>
> Style nitpick, I'd tend to prefer inlining the assignment:
>
>     if (!(s->handle = xcam_create_handle(s->name)))
>
> but I guess that's personal preference.

Please don't. There were many bugs because of stuffing the
assignment into the condition. It's not so likely to be
spotted once it's planted inside. IMHO the trade off for
most cases, saving one line, is not worth it.


> Overall looks fine, but someone more familiar with
> libavfilter should probably double-check.


  Alexander


More information about the ffmpeg-devel mailing list