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

Stefano Sabatini stefasab at gmail.com
Tue Sep 24 19:27:49 CEST 2013


On date Tuesday 2013-09-24 15:50:09 +0000, Paul B Mahol encoded:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
> 
> I would prefer that there is much simpler way to do same.
> 
> ---
> 
>  libavfilter/af_volume.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)

Reminder: add missing docs, bump micro

> diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
> index a777249..fc9afb7 100644
> --- a/libavfilter/af_volume.c
> +++ b/libavfilter/af_volume.c
> @@ -269,6 +269,22 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
>      return ff_filter_frame(outlink, out_buf);
>  }
>  
> +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.

[...]
-- 
FFmpeg = Fascinating Fancy Mind-dumbing Peaceless Erratic Gadget


More information about the ffmpeg-devel mailing list