From 91583fccac85880ad2199f50463c095560791d56 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 30 Jun 2017 16:39:36 +0200 Subject: options: change path list options, and document list options The changes to path list options is basically getting rid of the need to pass multiple paths to a single option. Instead, you can use the option multiple times. The old behavior can be used by using the -set suffix with the option. Change some options to path lists. For example --script is now append by default, and if you use --script-set, you need to use ":"/";" as separator instead of ",". --sub-paths/--audio-file-paths is a deprecated alias now, and will break if the user tries to pass multiple paths to it. I'm assuming that if these are used, most users will pass only 1 path anyway. --opengl-shaders has more compatibility handling, since it's probably rather common that users pass multiple options to it. Also document all that in the manpage. I'll probably regret this later, as it somewhat increases the complexity of the option parser, rather than increasing it. --- video/out/opengl/video.c | 7 ++++++- video/out/opengl/video.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'video') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index b158f03c12..d21a3d397a 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -375,7 +375,9 @@ const struct m_sub_options gl_video_conf = { ({"no", BLEND_SUBS_NO}, {"yes", BLEND_SUBS_YES}, {"video", BLEND_SUBS_VIDEO})), - OPT_STRINGLIST("opengl-shaders", user_shaders, M_OPT_FILE), + OPT_STRINGLIST("opengl-shaders", user_shaders_old, M_OPT_FILE, + .deprecation_message = "use --opengl-shader (1 for each file)"), + OPT_PATHLIST("opengl-shader", user_shaders, 0), OPT_FLAG("deband", deband, 0), OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0), OPT_FLOAT("sharpen", unsharp, 0), @@ -1645,6 +1647,7 @@ static void gl_video_setup_hooks(struct gl_video *p) }); } + pass_hook_user_shaders(p, p->opts.user_shaders_old); pass_hook_user_shaders(p, p->opts.user_shaders); } @@ -2989,6 +2992,8 @@ static bool check_dumb_mode(struct gl_video *p) return false; } } + if (o->user_shaders_old && o->user_shaders_old[0]) + return false; if (o->user_shaders && o->user_shaders[0]) return false; if (p->use_lut_3d) diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h index 3b6533e0ef..55fd18461a 100644 --- a/video/out/opengl/video.h +++ b/video/out/opengl/video.h @@ -128,6 +128,7 @@ struct gl_video_opts { int interpolation; float interpolation_threshold; int blend_subs; + char **user_shaders_old; char **user_shaders; int deband; struct deband_opts *deband_opts; -- cgit v1.2.3