[FFmpeg-devel] [PATCH 2/2] lavfi/sendcmd: correct the option flags dump

mypopy at gmail.com mypopy at gmail.com
Mon Sep 14 04:48:36 EEST 2020


On Sun, Sep 13, 2020 at 6:30 PM Paul B Mahol <onemda at gmail.com> wrote:
>
> On Sun, Sep 13, 2020 at 12:40:45PM +0800, Jun Zhao wrote:
> > From: Jun Zhao <barryjzhao at tencent.com>
> >
> > correct the option flags dump for sendcmd/asendcmd.
> >
> > Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
> > ---
> >  libavfilter/f_sendcmd.c | 26 ++++++++++++++++----------
> >  1 file changed, 16 insertions(+), 10 deletions(-)
> >
> > diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c
> > index 6b02669..5e4c891 100644
> > --- a/libavfilter/f_sendcmd.c
> > +++ b/libavfilter/f_sendcmd.c
> > @@ -103,14 +103,6 @@ typedef struct SendCmdContext {
> >  } SendCmdContext;
> >
> >  #define OFFSET(x) offsetof(SendCmdContext, x)
> > -#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_VIDEO_PARAM
> > -static const AVOption options[] = {
> > -    { "commands", "set commands", OFFSET(commands_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
> > -    { "c",        "set commands", OFFSET(commands_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
> > -    { "filename", "set commands file",  OFFSET(commands_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
> > -    { "f",        "set commands file",  OFFSET(commands_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS },
> > -    { NULL }
> > -};
>
> Cant you use macro somehow?, because you are duplicating most of lines/code.
>
Will try to remove the redundant, thx


More information about the ffmpeg-devel mailing list