summaryrefslogtreecommitdiffstats
path: root/video/out/vo_gpu_next.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2023-08-27 13:51:00 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2023-08-27 14:39:45 +0200
commit23e9b57791c6788896b00d8ceadc7cf17153a35d (patch)
treeb0577795d8968e612ddec323db11760fe54f94fa /video/out/vo_gpu_next.c
parent87aa65285b938d4778e9d7c9d77a1530b7620c15 (diff)
downloadmpv-23e9b57791c6788896b00d8ceadc7cf17153a35d.tar.bz2
mpv-23e9b57791c6788896b00d8ceadc7cf17153a35d.tar.xz
vo_gpu_next: don't nuke main options state in video_screenshot
This actually fixes a bug that was present in this code even before the new pl_options system, which is that `video_screenshot` would permanently leave `peak_detect_params.allow_delayed` as false, until something else forced options re-application due to options cache change.
Diffstat (limited to 'video/out/vo_gpu_next.c')
-rw-r--r--video/out/vo_gpu_next.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index ecb80eeea1..85d38e42c6 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -1185,11 +1185,18 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
args->res = NULL;
update_options(vo);
- pars->params.info_callback = NULL;
- pars->params.skip_caching_single_frame = true;
- pars->params.preserve_mixing_cache = false;
- pars->params.frame_mixer = NULL;
- pars->peak_detect_params.allow_delayed = false;
+ struct pl_render_params params = pars->params;
+ params.info_callback = NULL;
+ params.skip_caching_single_frame = true;
+ params.preserve_mixing_cache = false;
+ params.frame_mixer = NULL;
+
+ struct pl_peak_detect_params peak_params;
+ if (params.peak_detect_params) {
+ peak_params = *params.peak_detect_params;
+ params.peak_detect_params = &peak_params;
+ peak_params.allow_delayed = false;
+ }
// Retrieve the current frame from the frame queue
struct pl_frame_mix mix;
@@ -1290,7 +1297,7 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
&p->osd_state, &target);
image.num_overlays = 0; // Disable on-screen overlays
- if (!pl_render_image(p->rr, &image, &target, &pars->params)) {
+ if (!pl_render_image(p->rr, &image, &target, &params)) {
MP_ERR(vo, "Failed rendering frame!\n");
goto done;
}