diff options
author | Niklas Haas <git@haasn.dev> | 2025-08-07 21:51:40 +0200 |
---|---|---|
committer | Niklas Haas <ffmpeg@haasn.dev> | 2025-08-08 11:29:27 +0000 |
commit | 6627c8ea4b4e4e0f9312d3243c099eb5df1a89e7 (patch) | |
tree | 51d6fc0ba71c49d44b4d445373a45f7154665b4c | |
parent | e57874768a2e43c31ad7865630f24cfeb2e5df26 (diff) | |
download | ffmpeg-6627c8ea4b4e4e0f9312d3243c099eb5df1a89e7.tar.gz |
avfilter/vf_libplacebo: skip empty inputs
It is possible for pl_queue_update() to return PL_QUEUE_OK, but to generate
an empty frame mix. This happens if the first frame of that input is in the
future.
In this case, we should skip an input as not active, similar to inputs that
have already reached EOF.
-rw-r--r-- | libavfilter/vf_libplacebo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 7e30524455..caeebc25be 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -1017,7 +1017,7 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) FilterLink *il = ff_filter_link(ctx->inputs[i]); FilterLink *ol = ff_filter_link(outlink); int high_fps = av_cmp_q(il->frame_rate, ol->frame_rate) >= 0; - if (in->qstatus != PL_QUEUE_OK) + if (in->qstatus != PL_QUEUE_OK || !in->mix.num_frames) continue; opts->params.skip_caching_single_frame = high_fps; update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base)); @@ -1205,7 +1205,7 @@ static int libplacebo_activate(AVFilterContext *ctx) retry = true; break; case PL_QUEUE_OK: - ok = true; + ok |= in->mix.num_frames > 0; break; case PL_QUEUE_ERR: return AVERROR_EXTERNAL; |