[FFmpeg-cvslog] avfilter/vf_blend: add timeline support to tblend filter

Paul B Mahol git at videolan.org
Mon May 14 19:28:48 EEST 2018


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon May 14 17:58:27 2018 +0200| [a27cab9eca631d9b27fafb4efadde99bae33383b] | committer: Paul B Mahol

avfilter/vf_blend: add timeline support to tblend filter

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a27cab9eca631d9b27fafb4efadde99bae33383b
---

 libavfilter/vf_blend.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 70c37c75da..e83a0db640 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -626,11 +626,17 @@ AVFilter ff_vf_blend = {
 
 static int tblend_filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
-    BlendContext *s = inlink->dst->priv;
-    AVFilterLink *outlink = inlink->dst->outputs[0];
+    AVFilterContext *ctx = inlink->dst;
+    BlendContext *s = ctx->priv;
+    AVFilterLink *outlink = ctx->outputs[0];
 
     if (s->prev_frame) {
-        AVFrame *out = blend_frame(inlink->dst, frame, s->prev_frame);
+        AVFrame *out;
+
+        if (ctx->is_disabled)
+            out = av_frame_clone(frame);
+        else
+            out = blend_frame(ctx, frame, s->prev_frame);
         av_frame_free(&s->prev_frame);
         s->prev_frame = frame;
         return ff_filter_frame(outlink, out);
@@ -674,7 +680,7 @@ AVFilter ff_vf_tblend = {
     .uninit        = uninit,
     .inputs        = tblend_inputs,
     .outputs       = tblend_outputs,
-    .flags         = AVFILTER_FLAG_SLICE_THREADS,
+    .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
 };
 
 #endif



More information about the ffmpeg-cvslog mailing list