summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-08 22:55:01 +0200
committerwm4 <wm4@nowhere>2015-09-08 22:55:01 +0200
commitf622f9d3a3b8bf78cea16bd79f3704e24f9e4827 (patch)
treef4a13e2055a60de337c30a02bc252fd3aebef9e5 /video
parentab6f6aa61e491f214bc486ad512bfdadc5932fcf (diff)
downloadmpv-f622f9d3a3b8bf78cea16bd79f3704e24f9e4827.tar.bz2
mpv-f622f9d3a3b8bf78cea16bd79f3704e24f9e4827.tar.xz
vo_opengl: filter allowed options in dumb-mode
Instead of the other way around of disabling disallowed options. This is more robust and also slightly simpler, at least conceptually. If new vo_opengl features are added, they don't need to be explicitly disabled for dumb-mode just to avoid that it accidentally breaks.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_video.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 38f2e546e3..967de2a6aa 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -2399,21 +2399,21 @@ static void check_gl_features(struct gl_video *p)
MP_WARN(p, "High bit depth FBOs unsupported. Enabling dumb mode.\n"
"Most extended features will be disabled.\n");
}
- p->opts.dumb_mode = 1;
- for (int n = 0; n < 4; n++)
- p->opts.scaler[n].kernel.name = "bilinear";
p->use_lut_3d = false;
- p->opts.dither_algo = -1;
- p->opts.interpolation = 0;
- p->opts.blend_subs = 0;
- p->opts.linear_scaling = 0;
- p->opts.sigmoid_upscaling = 0;
- p->opts.target_prim = MP_CSP_PRIM_AUTO;
- p->opts.target_trc = MP_CSP_TRC_AUTO;
- talloc_free(p->opts.source_shader); p->opts.source_shader = NULL;
- talloc_free(p->opts.scale_shader); p->opts.scale_shader = NULL;
- talloc_free(p->opts.pre_shaders); p->opts.pre_shaders = NULL;
- talloc_free(p->opts.post_shaders); p->opts.post_shaders = NULL;
+ // Most things don't work, so whitelist all options that still work.
+ struct gl_video_opts new_opts = {
+ .gamma = p->opts.gamma,
+ .gamma_auto = p->opts.gamma_auto,
+ .pbo = p->opts.pbo,
+ .fbo_format = p->opts.fbo_format,
+ .alpha_mode = p->opts.alpha_mode,
+ .chroma_location = p->opts.chroma_location,
+ .use_rectangle = p->opts.use_rectangle,
+ .background = p->opts.background,
+ .dither_algo = -1,
+ .dumb_mode = 1,
+ };
+ assign_options(&p->opts, &new_opts);
return;
}