Commit 4022f7f54a for ffmpeg
commit 4022f7f54a634f96b9d4f2fc1bc27bcfba7dcd93
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Wed Sep 23 22:17:09 2026 +0200
avfilter/vf_xfade_opencl: keep the rescaled transition duration nonzero
Found during review of #24165
diff --git a/libavfilter/vf_xfade_opencl.c b/libavfilter/vf_xfade_opencl.c
index 96dc7e4554..e13a17c4cc 100644
--- a/libavfilter/vf_xfade_opencl.c
+++ b/libavfilter/vf_xfade_opencl.c
@@ -248,8 +248,9 @@ static int xfade_opencl_config_output(AVFilterLink *outlink)
outlink->sample_aspect_ratio = inlink0->sample_aspect_ratio;
ol->frame_rate = il->frame_rate;
- if (ctx->duration)
- ctx->duration_pts = av_rescale_q(ctx->duration, AV_TIME_BASE_Q, outlink->time_base);
+ ctx->duration_pts = av_rescale_q(ctx->duration, AV_TIME_BASE_Q, outlink->time_base);
+ if (!ctx->duration_pts)
+ ctx->duration_pts = 1;
if (ctx->offset)
ctx->offset_pts = av_rescale_q(ctx->offset, AV_TIME_BASE_Q, outlink->time_base);