diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-09-24 16:20:53 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-09-27 12:49:55 +0000 |
commit | 110a2f446d54541d4e419cf20494223dd6a1a1f9 (patch) | |
tree | 0380ed8895945055889486dc8f5774ca5ad65b6e /libavfilter/af_ladspa.c | |
parent | 4d86a945dfe7c31dfdc0f27f3df1579f07ed6b17 (diff) | |
download | ffmpeg-110a2f446d54541d4e419cf20494223dd6a1a1f9.tar.gz |
avfilter/af_ladspa: allow changing controls dynamically
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_ladspa.c')
-rw-r--r-- | libavfilter/af_ladspa.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavfilter/af_ladspa.c b/libavfilter/af_ladspa.c index 45f17ffbf3..3ceb91e739 100644 --- a/libavfilter/af_ladspa.c +++ b/libavfilter/af_ladspa.c @@ -662,6 +662,18 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&ctx->input_pads[0].name); } +static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, + char *res, int res_len, int flags) +{ + LADSPA_Data value; + unsigned long port; + + if (sscanf(cmd, "c%ld", &port) + sscanf(args, "%f", &value) != 2) + return AVERROR(EINVAL); + + return set_control(ctx, port, value); +} + static const AVFilterPad ladspa_outputs[] = { { .name = "default", @@ -680,6 +692,7 @@ AVFilter avfilter_af_ladspa = { .init = init, .uninit = uninit, .query_formats = query_formats, + .process_command = process_command, .inputs = 0, .outputs = ladspa_outputs, .flags = AVFILTER_FLAG_DYNAMIC_INPUTS, |