summaryrefslogtreecommitdiff
path: root/libavfilter/vf_mix.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-04-29 19:27:15 +0200
committerPaul B Mahol <onemda@gmail.com>2018-04-29 19:27:15 +0200
commitc0f2abcc8d2acfc95e675a05303db958c3866b03 (patch)
treeb9d58ba83908725666fbf9f4779e569e3e9fc3df /libavfilter/vf_mix.c
parent6e95d80e6fae978f8a44afc24b0c5097a062719f (diff)
avfilter/vf_mix: make setting weights more user friendly
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_mix.c')
-rw-r--r--libavfilter/vf_mix.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c
index 9ae61c59d2..14e0f19e2d 100644
--- a/libavfilter/vf_mix.c
+++ b/libavfilter/vf_mix.c
@@ -74,7 +74,7 @@ static av_cold int init(AVFilterContext *ctx)
{
MixContext *s = ctx->priv;
char *p, *arg, *saveptr = NULL;
- int i, ret;
+ int i, ret, last;
s->tmix = !strcmp(ctx->filter->name, "tmix");
@@ -110,6 +110,11 @@ static av_cold int init(AVFilterContext *ctx)
p = NULL;
sscanf(arg, "%f", &s->weights[i]);
s->wfactor += s->weights[i];
+ last = i;
+ }
+ for (; i < s->nb_inputs; i++) {
+ s->weights[i] = s->weights[last];
+ s->wfactor += s->weights[i];
}
if (s->scale == 0) {
s->wfactor = 1 / s->wfactor;