aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_afir.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-04-16 19:06:09 +0200
committerPaul B Mahol <onemda@gmail.com>2018-04-16 19:11:35 +0200
commit6e05a11e8968d1781cc60666aa130520259cc1b1 (patch)
tree1bbca46dee706676af1e978aeba64b880487c566 /libavfilter/af_afir.c
parent6838359448faeceb4830e7a1cf3ca6e36fb7e4a7 (diff)
downloadffmpeg-6e05a11e8968d1781cc60666aa130520259cc1b1.tar.gz
avfilter/af_afir: make max IR length configurable
Also increase max allowed dry/wet value. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_afir.c')
-rw-r--r--libavfilter/af_afir.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c
index 6687242631..9318484cd0 100644
--- a/libavfilter/af_afir.c
+++ b/libavfilter/af_afir.c
@@ -290,7 +290,7 @@ static int read_ir(AVFilterLink *link, AVFrame *frame)
return ret;
nb_taps = av_audio_fifo_size(s->fifo[1]);
- max_nb_taps = MAX_IR_DURATION * ctx->outputs[0]->sample_rate;
+ max_nb_taps = s->max_ir_len * ctx->outputs[0]->sample_rate;
if (nb_taps > max_nb_taps) {
av_log(ctx, AV_LOG_ERROR, "Too big number of coefficients: %d > %d.\n", nb_taps, max_nb_taps);
return AVERROR(EINVAL);
@@ -533,10 +533,11 @@ static const AVFilterPad afir_outputs[] = {
#define OFFSET(x) offsetof(AudioFIRContext, x)
static const AVOption afir_options[] = {
- { "dry", "set dry gain", OFFSET(dry_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF },
- { "wet", "set wet gain", OFFSET(wet_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF },
- { "length", "set IR length", OFFSET(length), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF },
- { "again", "enable auto gain", OFFSET(again), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, AF },
+ { "dry", "set dry gain", OFFSET(dry_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, AF },
+ { "wet", "set wet gain", OFFSET(wet_gain), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, AF },
+ { "length", "set IR length", OFFSET(length), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF },
+ { "again", "enable auto gain", OFFSET(again), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, AF },
+ { "maxir", "set max ir length", OFFSET(max_ir_len), AV_OPT_TYPE_FLOAT, {.dbl=30}, 0.1, 60, AF },
{ NULL }
};