diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-11-25 12:44:07 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-11-25 12:57:13 +0100 |
commit | 5b106215babec37dfb0b38efdff6d2c844adfe41 (patch) | |
tree | a5982a3b5bf997e0c79b5a0176f08f41ba94e5ef /libavfilter/af_sidechaincompress.c | |
parent | 29af74e4e36daa3aa3ebafede844412d8cfff32b (diff) | |
download | ffmpeg-5b106215babec37dfb0b38efdff6d2c844adfe41.tar.gz |
avfilter/af_sidechaincompress: add forgotten option
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_sidechaincompress.c')
-rw-r--r-- | libavfilter/af_sidechaincompress.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/af_sidechaincompress.c b/libavfilter/af_sidechaincompress.c index 29b3753691..25f3fd182d 100644 --- a/libavfilter/af_sidechaincompress.c +++ b/libavfilter/af_sidechaincompress.c @@ -44,6 +44,7 @@ typedef struct SidechainCompressContext { double ratio; double threshold; double makeup; + double mix; double thres; double knee; double knee_start; @@ -73,6 +74,7 @@ static const AVOption sidechaincompress_options[] = { { "detection", "set detection", OFFSET(detection), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, A|F, "detection" }, { "peak", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A|F, "detection" }, { "rms", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A|F, "detection" }, + { "mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, A|F }, { NULL } }; @@ -131,6 +133,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) AVFilterLink *sclink = ctx->inputs[1]; AVFilterLink *outlink = ctx->outputs[0]; const double makeup = s->makeup; + const double mix = s->mix; const double *scsrc; double *sample; int nb_samples; @@ -177,7 +180,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) s->compressed_knee_stop, s->detection); for (c = 0; c < outlink->channels; c++) - sample[c] *= gain * makeup; + sample[c] *= (gain * makeup * mix + (1. - mix)); sample += outlink->channels; scsrc += sclink->channels; |