From 4dcf2d13850ca443d40dd07546b795cd0c231fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 14 Nov 2023 09:21:08 +0100 Subject: vo_gpu_next: request more frames to account for anti aliasing libplacebo requires additional frames when VPS is lower than FPS and anti-aliasing is enabled. Supports up to a 1/4 ratio. VO has a limit of 10 frames, so in practice, not many more can fit. Note that the internal libplacebo mixing limit is 16 frames. --- video/out/vo_gpu_next.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'video/out') diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 3d976c6301..14a25073d0 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1949,11 +1949,15 @@ static void update_render_options(struct vo *vo) pars->params.plane_upscaler = map_scaler(p, SCALER_CSCALE); pars->params.frame_mixer = opts->interpolation ? map_scaler(p, SCALER_TSCALE) : NULL; - // Request as many frames as required from the decoder + // Request as many frames as required from the decoder, depending on the + // speed VPS/FPS ratio libplacebo may need more frames. Request frames up to + // ratio of 1/4, but only if anti aliasing is enabled. int req_frames = 2; - if (pars->params.frame_mixer) - req_frames += ceilf(pars->params.frame_mixer->kernel->radius); - vo_set_queue_params(vo, 0, req_frames); + if (pars->params.frame_mixer) { + req_frames += ceilf(pars->params.frame_mixer->kernel->radius) * + (pars->params.skip_anti_aliasing ? 1 : 4); + } + vo_set_queue_params(vo, 0, MPMIN(VO_MAX_REQ_FRAMES, req_frames)); pars->params.deband_params = opts->deband ? &pars->deband_params : NULL; pars->deband_params.iterations = opts->deband_opts->iterations; -- cgit v1.2.3