diff options
author | Dudemanguy <random342@airmail.cc> | 2023-08-02 18:27:28 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-08-05 14:01:02 +0000 |
commit | 59ac302dff06433c5fe46a3d3beeb63df18bea9e (patch) | |
tree | 44363c99779784ea66873ef4b707c6f46a386dcf /video | |
parent | 65a95a721ee23c45a7fedef5d2174b3f1ed13b6d (diff) | |
download | mpv-59ac302dff06433c5fe46a3d3beeb63df18bea9e.tar.bz2 mpv-59ac302dff06433c5fe46a3d3beeb63df18bea9e.tar.xz |
vo_gpu/vo_gpu_next: fix setting an empty dscale
The manual currently says that if dscale is unset, --scale will be
applied. However, this only works at init time. If you change the dscale
filter to be empty later, vo_gpu will segfault and vo_gpu_next will
throw an error and refuse the changes. That's because when the option is
unset at runtime, the value becomes "" not NULL and the vo's never
accounted for this. Fixes #12031.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/gpu/video.c | 6 | ||||
-rw-r--r-- | video/out/vo_gpu_next.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 73bd191740..db0d045852 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -1729,6 +1729,12 @@ static void reinit_scaler(struct gl_video *p, struct scaler *scaler, uninit_scaler(p, scaler); + if (conf && scaler->index == SCALER_DSCALE && (!conf->kernel.name || + !conf->kernel.name[0])) + { + conf = &p->opts.scaler[SCALER_SCALE]; + } + struct filter_kernel bare_window; const struct filter_kernel *t_kernel = mp_find_filter_kernel(conf->kernel.name); const struct filter_window *t_window = mp_find_filter_window(conf->window.name); diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 3fe068c279..6a9d20cbb0 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1542,7 +1542,7 @@ static const struct pl_filter_config *map_scaler(struct priv *p, const struct gl_video_opts *opts = p->opts_cache->opts; const struct scaler_config *cfg = &opts->scaler[unit]; - if (unit == SCALER_DSCALE && !cfg->kernel.name) + if (unit == SCALER_DSCALE && (!cfg->kernel.name || !strcmp(cfg->kernel.name, ""))) cfg = &opts->scaler[SCALER_SCALE]; for (int i = 0; fixed_presets[i].name; i++) { |