summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-11-14 09:21:08 +0100
committerDudemanguy <random342@airmail.cc>2023-11-18 22:54:29 +0000
commit4dcf2d13850ca443d40dd07546b795cd0c231fbe (patch)
treec2390c62a9c8a98b8def6265915c326dc709211c /video
parentc8a2f8eb7f5117e4148e8d1b473b19ded574244f (diff)
downloadmpv-4dcf2d13850ca443d40dd07546b795cd0c231fbe.tar.bz2
mpv-4dcf2d13850ca443d40dd07546b795cd0c231fbe.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_gpu_next.c12
1 files changed, 8 insertions, 4 deletions
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;