[FFmpeg-devel] [PATCH] avfilter/af_volume: add support for command

wm4 nfxjfg at googlemail.com
Tue Sep 24 20:03:18 CEST 2013


On Tue, 24 Sep 2013 19:27:49 +0200
Stefano Sabatini <stefasab at gmail.com> wrote:

> > +static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
> > +                           char *res, int res_len, int flags)
> > +{
> > +    VolumeContext *vol = ctx->priv;
> > +    int ret;
> > +
> > +    if (!strcmp(cmd, "volume")) {
> > +        scanf("%lf", &vol->volume);
> > +        init(ctx);
> > +        ret = 0;
> 
> I know that it sucks, but sscanf is not the equivalent of
> av_opt_set(). Ideally we should have an expression and use some common
> code for init and process.

ubitux suggested on IRC to add a flag for reconfigurable avoptions. You
would perhaps also need a callback that is invoked once the option is
set to a new value. The callback could be either per filter, or per
option. All in all, it should be much simpler and more powerful than
this process_command mess.


More information about the ffmpeg-devel mailing list