summaryrefslogtreecommitdiff
path: root/libavfilter/vf_lagfun.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-02-11 00:30:07 +0100
committerPaul B Mahol <onemda@gmail.com>2021-02-11 00:45:08 +0100
commit05b394d5376fe987046b9f52da535301365102ec (patch)
treee66cfcda7c3418fa00bc9b8667fca6a89ca914ab /libavfilter/vf_lagfun.c
parent27b5d0e1e4ba47b4fb30c73d3f99491e9836bc90 (diff)
downloadffmpeg-05b394d5376fe987046b9f52da535301365102ec.tar.gz
avfilter/vf_lagfun: add timeline support
Diffstat (limited to 'libavfilter/vf_lagfun.c')
-rw-r--r--libavfilter/vf_lagfun.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libavfilter/vf_lagfun.c b/libavfilter/vf_lagfun.c
index 8f08888841..9e2e0726c7 100644
--- a/libavfilter/vf_lagfun.c
+++ b/libavfilter/vf_lagfun.c
@@ -104,7 +104,11 @@ static int lagfun_frame8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs
float v = FFMAX(src[x], osrc[x] * decay);
osrc[x] = v;
- dst[x] = lrintf(v);
+ if (ctx->is_disabled) {
+ dst[x] = src[x];
+ } else {
+ dst[x] = lrintf(v);
+ }
}
src += in->linesize[p];
@@ -143,7 +147,11 @@ static int lagfun_frame16(AVFilterContext *ctx, void *arg, int jobnr, int nb_job
float v = FFMAX(src[x], osrc[x] * decay);
osrc[x] = v;
- dst[x] = lrintf(v);
+ if (ctx->is_disabled) {
+ dst[x] = src[x];
+ } else {
+ dst[x] = lrintf(v);
+ }
}
src += in->linesize[p] / 2;
@@ -256,6 +264,6 @@ AVFilter ff_vf_lagfun = {
.uninit = uninit,
.outputs = outputs,
.inputs = inputs,
- .flags = AVFILTER_FLAG_SLICE_THREADS,
+ .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
.process_command = ff_filter_process_command,
};