diff options
author | Niklas Haas <git@haasn.dev> | 2023-08-27 13:51:00 +0200 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2023-08-27 14:39:45 +0200 |
commit | 23e9b57791c6788896b00d8ceadc7cf17153a35d (patch) | |
tree | b0577795d8968e612ddec323db11760fe54f94fa | |
parent | 87aa65285b938d4778e9d7c9d77a1530b7620c15 (diff) | |
download | mpv-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.
-rw-r--r-- | video/out/vo_gpu_next.c | 19 |
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, ¶ms)) { MP_ERR(vo, "Failed rendering frame!\n"); goto done; } |