From ef856ef93ef6c449f546c10f86c820d4dafe2fdc Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 12 Aug 2025 12:20:11 +0200 Subject: [PATCH] avfilter/vf_libplacebo: also output a frame during input gaps In constant FPS mode, it's possible for there no be *no* input active at the current timestamp, even though there would be active inputs later in the timeline (nb_active > 0). This would previously hit the AVERROR_BUG case. With this change, we can instead output an empty frame. --- libavfilter/vf_libplacebo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index e3761bead8..2e7e83e8db 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -1243,6 +1243,10 @@ static int libplacebo_activate(AVFilterContext *ctx) } } + /* In constant FPS mode, we can also output an empty frame if there is + * a gap in the input timeline and we still have active streams */ + ok |= s->fps.num && s->nb_active > 0; + if (retry) { return 0; } else if (ok) {