1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

options: add M_OPT_FILE to some more file options

(Helps shell completion.)
This commit is contained in:
Philip Sequeira 2017-03-05 16:47:36 -05:00 committed by wm4
parent 1245ac1dc5
commit a2a5fa4545
7 changed files with 10 additions and 10 deletions

View File

@ -219,7 +219,7 @@ const struct ao_driver audio_out_pcm = {
.priv_size = sizeof(struct priv),
.priv_defaults = &(const struct priv) { .waveheader = 1 },
.options = (const struct m_option[]) {
OPT_STRING("file", outputfilename, 0),
OPT_STRING("file", outputfilename, M_OPT_FILE),
OPT_FLAG("waveheader", waveheader, 0),
OPT_FLAG("append", append, 0),
{0}

View File

@ -36,7 +36,7 @@
#define OPT_BASE_STRUCT struct encode_opts
const struct m_sub_options encode_config = {
.opts = (const m_option_t[]) {
OPT_STRING("o", file, M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE),
OPT_STRING("o", file, M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE),
OPT_STRING("of", format, M_OPT_FIXED),
OPT_STRINGLIST("ofopts*", fopts, M_OPT_FIXED),
OPT_FLOATRANGE("ofps", fps, M_OPT_FIXED, 0.0, 1000000.0),

View File

@ -305,7 +305,7 @@ const m_option_t mp_opts[] = {
#endif
OPT_FLAG("config", load_config, M_OPT_FIXED | CONF_PRE_PARSE),
OPT_STRING("config-dir", force_configdir,
M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE),
M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE),
OPT_STRINGLIST("reset-on-next-file", reset_options, 0),
#if HAVE_LUA
@ -618,7 +618,7 @@ const m_option_t mp_opts[] = {
OPT_FLAG("save-position-on-quit", position_save_on_quit, 0),
OPT_FLAG("write-filename-in-watch-later-config", write_filename_in_watch_later_config, 0),
OPT_FLAG("ignore-path-in-watch-later-config", ignore_path_in_watch_later_config, 0),
OPT_STRING("watch-later-directory", watch_later_directory, 0),
OPT_STRING("watch-later-directory", watch_later_directory, M_OPT_FILE),
OPT_FLAG("ordered-chapters", ordered_chapters, 0),
OPT_STRING("ordered-chapters-files", ordered_chapters_files, M_OPT_FILE),
@ -686,7 +686,7 @@ const m_option_t mp_opts[] = {
OPT_SUBSTRUCT("screenshot", screenshot_image_opts, screenshot_conf, 0),
OPT_STRING("screenshot-template", screenshot_template, 0),
OPT_STRING("screenshot-directory", screenshot_directory, 0),
OPT_STRING("screenshot-directory", screenshot_directory, M_OPT_FILE),
OPT_STRING("record-file", record_file, M_OPT_FILE),

View File

@ -736,7 +736,7 @@ static int vf_open(vf_instance_t *vf)
#define OPT_BASE_STRUCT struct vf_priv_s
static const m_option_t vf_opts_fields[] = {
OPT_STRING("file", cfg_file, 0),
OPT_STRING("file", cfg_file, M_OPT_FILE),
OPT_INTRANGE("buffered-frames", cfg_maxbuffer, 0, 1, 9999, OPTDEF_INT(4)),
OPT_CHOICE_OR_INT("concurrent-frames", cfg_maxrequests, 0, 1, 99,
({"auto", -1}), OPTDEF_INT(-1)),

View File

@ -77,9 +77,9 @@ static int validate_3dlut_size_opt(struct mp_log *log, const m_option_t *opt,
#define OPT_BASE_STRUCT struct mp_icc_opts
const struct m_sub_options mp_icc_conf = {
.opts = (const m_option_t[]) {
OPT_STRING("icc-profile", profile, 0),
OPT_STRING("icc-profile", profile, M_OPT_FILE),
OPT_FLAG("icc-profile-auto", profile_auto, 0),
OPT_STRING("icc-cache-dir", cache_dir, 0),
OPT_STRING("icc-cache-dir", cache_dir, M_OPT_FILE),
OPT_INT("icc-intent", intent, 0),
OPT_INTRANGE("icc-contrast", contrast, 0, 0, 100000),
OPT_STRING_VALIDATE("icc-3dlut-size", size_str, 0, validate_3dlut_size_opt),

View File

@ -380,7 +380,7 @@ 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, 0),
OPT_STRINGLIST("opengl-shaders", user_shaders, M_OPT_FILE),
OPT_FLAG("deband", deband, 0),
OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0),
OPT_FLOAT("sharpen", unsharp, 0),

View File

@ -57,7 +57,7 @@ struct vo_image_opts {
static const struct m_sub_options vo_image_conf = {
.opts = (const struct m_option[]) {
OPT_SUBSTRUCT("vo-image", opts, image_writer_conf, 0),
OPT_STRING("vo-image-outdir", outdir, 0),
OPT_STRING("vo-image-outdir", outdir, M_OPT_FILE),
{0},
},
.size = sizeof(struct vo_image_opts),