From 902bbdad35413436ff024c17d0ead774747f026f Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 27 Aug 2023 14:00:39 +0200 Subject: [PATCH] vo_gpu_next: update tmp params before rendering frame Gives the correct queue size value for the subsequent pl_queue_update() calls, which avoids a bit of unnecessary overhead. --- video/out/vo_gpu_next.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index a4a456750d..02b889b782 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -918,8 +918,14 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) update_options(vo); struct pl_render_params params = pars->params; + bool will_redraw = frame->display_synced && frame->num_vsyncs > 1; + bool cache_frame = will_redraw || frame->still; params.info_callback = info_callback; params.info_priv = vo; + params.skip_caching_single_frame = !cache_frame; + params.preserve_mixing_cache = p->inter_preserve && !frame->still; + if (frame->still) + params.frame_mixer = NULL; // Push all incoming frames into the frame queue for (int n = 0; n < frame->num_frames; n++) { @@ -1069,13 +1075,6 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) } } - bool will_redraw = frame->display_synced && frame->num_vsyncs > 1; - bool cache_frame = will_redraw || frame->still; - params.skip_caching_single_frame = !cache_frame; - params.preserve_mixing_cache = p->inter_preserve && !frame->still; - if (frame->still) - params.frame_mixer = NULL; - // Render frame if (!pl_render_image_mix(p->rr, &mix, &target, ¶ms)) { MP_ERR(vo, "Failed rendering frame!\n");