avfilter/vf_mix: add timeline support

This commit is contained in:
Paul B Mahol 2021-02-06 11:05:55 +01:00
parent e28b6e0448
commit 3583d2a837

View File

@ -201,6 +201,14 @@ static int process_frame(FFFrameSync *fs)
return ret; return ret;
} }
if (ctx->is_disabled) {
out = av_frame_clone(s->frames[0]);
if (!out)
return AVERROR(ENOMEM);
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
return ff_filter_frame(outlink, out);
}
out = ff_get_video_buffer(outlink, outlink->w, outlink->h); out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) if (!out)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -337,7 +345,8 @@ AVFilter ff_vf_mix = {
.init = init, .init = init,
.uninit = uninit, .uninit = uninit,
.activate = activate, .activate = activate,
.flags = AVFILTER_FLAG_DYNAMIC_INPUTS | AVFILTER_FLAG_SLICE_THREADS, .flags = AVFILTER_FLAG_DYNAMIC_INPUTS | AVFILTER_FLAG_SLICE_THREADS |
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
}; };
#endif /* CONFIG_MIX_FILTER */ #endif /* CONFIG_MIX_FILTER */