mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 16:33:02 +00:00
m_options: get rid of CONF_NOSAVE
This was already treated like CONF_GLOBAL. Profiles can actually be file-local, as long as the profile sets file local options only. Allow them to do so.
This commit is contained in:
parent
6031b8e22c
commit
70c455a596
@ -665,8 +665,8 @@ const m_option_t mplayer_opts[]={
|
|||||||
OPT_INTRANGE("x", screen_size_x, 0, 0, 4096),
|
OPT_INTRANGE("x", screen_size_x, 0, 0, 4096),
|
||||||
OPT_INTRANGE("y", screen_size_y, 0, 0, 4096),
|
OPT_INTRANGE("y", screen_size_y, 0, 0, 4096),
|
||||||
// set screen dimensions (when not detectable or virtual!=visible)
|
// set screen dimensions (when not detectable or virtual!=visible)
|
||||||
OPT_INTRANGE("screenw", vo_screenwidth, CONF_NOSAVE, 0, 4096),
|
OPT_INTRANGE("screenw", vo_screenwidth, CONF_GLOBAL, 0, 4096),
|
||||||
OPT_INTRANGE("screenh", vo_screenheight, CONF_NOSAVE, 0, 4096),
|
OPT_INTRANGE("screenh", vo_screenheight, CONF_GLOBAL, 0, 4096),
|
||||||
// Geometry string
|
// Geometry string
|
||||||
{"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
{"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||||
OPT_MAKE_FLAGS("force-window-position", force_window_position, 0),
|
OPT_MAKE_FLAGS("force-window-position", force_window_position, 0),
|
||||||
@ -679,7 +679,7 @@ const m_option_t mplayer_opts[]={
|
|||||||
// video mode switching: (x11,xv,dga)
|
// video mode switching: (x11,xv,dga)
|
||||||
OPT_MAKE_FLAGS("vm", vidmode, 0),
|
OPT_MAKE_FLAGS("vm", vidmode, 0),
|
||||||
// start in fullscreen mode:
|
// start in fullscreen mode:
|
||||||
OPT_MAKE_FLAGS("fs", fullscreen, CONF_NOSAVE),
|
OPT_MAKE_FLAGS("fs", fullscreen, CONF_GLOBAL),
|
||||||
// set fullscreen switch method (workaround for buggy WMs)
|
// set fullscreen switch method (workaround for buggy WMs)
|
||||||
{"fsmode-dontuse", &vo_fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL},
|
{"fsmode-dontuse", &vo_fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL},
|
||||||
// set bpp (x11+vm, dga, fbdev, vesa, svga?)
|
// set bpp (x11+vm, dga, fbdev, vesa, svga?)
|
||||||
|
@ -196,7 +196,7 @@ struct m_config *m_config_new(void *optstruct,
|
|||||||
char *filename))
|
char *filename))
|
||||||
{
|
{
|
||||||
static const struct m_option ref_opts[] = {
|
static const struct m_option ref_opts[] = {
|
||||||
{ "profile", NULL, CONF_TYPE_STRING_LIST, CONF_NOSAVE, 0, 0, NULL },
|
{ "profile", NULL, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL },
|
||||||
{ "show-profile", show_profile, CONF_TYPE_PRINT_FUNC, CONF_NOCFG },
|
{ "show-profile", show_profile, CONF_TYPE_PRINT_FUNC, CONF_NOCFG },
|
||||||
{ "list-options", list_options, CONF_TYPE_PRINT_FUNC, CONF_NOCFG },
|
{ "list-options", list_options, CONF_TYPE_PRINT_FUNC, CONF_NOCFG },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
@ -212,7 +212,7 @@ struct m_config *m_config_new(void *optstruct,
|
|||||||
if (includefunc) {
|
if (includefunc) {
|
||||||
struct m_option *p = talloc_ptrtype(config, p);
|
struct m_option *p = talloc_ptrtype(config, p);
|
||||||
*p = (struct m_option){
|
*p = (struct m_option){
|
||||||
"include", NULL, CONF_TYPE_STRING, CONF_NOSAVE,
|
"include", NULL, CONF_TYPE_STRING, 0,
|
||||||
};
|
};
|
||||||
m_config_add_option(config, p, NULL, NULL);
|
m_config_add_option(config, p, NULL, NULL);
|
||||||
config->includefunc = includefunc;
|
config->includefunc = includefunc;
|
||||||
@ -232,7 +232,7 @@ static void ensure_backup(struct m_config *config, struct m_config_option *co)
|
|||||||
return;
|
return;
|
||||||
if (co->opt->type->flags & M_OPT_TYPE_HAS_CHILD)
|
if (co->opt->type->flags & M_OPT_TYPE_HAS_CHILD)
|
||||||
return;
|
return;
|
||||||
if (co->opt->flags & (M_OPT_GLOBAL | M_OPT_NOSAVE))
|
if (co->opt->flags & M_OPT_GLOBAL)
|
||||||
return;
|
return;
|
||||||
if (co->flags & M_CFG_OPT_ALIAS)
|
if (co->flags & M_CFG_OPT_ALIAS)
|
||||||
return;
|
return;
|
||||||
|
@ -284,13 +284,6 @@ struct m_option {
|
|||||||
*/
|
*/
|
||||||
#define M_OPT_GLOBAL (1 << 4)
|
#define M_OPT_GLOBAL (1 << 4)
|
||||||
|
|
||||||
// The \ref Config won't save this option on push.
|
|
||||||
/** It won't be saved on push but the command line parser will add it with
|
|
||||||
* its entry (i.e. it may be set later)
|
|
||||||
* e.g options : -include
|
|
||||||
*/
|
|
||||||
#define M_OPT_NOSAVE (1 << 5)
|
|
||||||
|
|
||||||
// The option should be set during command line pre-parsing
|
// The option should be set during command line pre-parsing
|
||||||
#define M_OPT_PRE_PARSE (1 << 6)
|
#define M_OPT_PRE_PARSE (1 << 6)
|
||||||
|
|
||||||
@ -306,7 +299,6 @@ struct m_option {
|
|||||||
#define CONF_NOCFG M_OPT_NOCFG
|
#define CONF_NOCFG M_OPT_NOCFG
|
||||||
#define CONF_NOCMD M_OPT_NOCMD
|
#define CONF_NOCMD M_OPT_NOCMD
|
||||||
#define CONF_GLOBAL M_OPT_GLOBAL
|
#define CONF_GLOBAL M_OPT_GLOBAL
|
||||||
#define CONF_NOSAVE M_OPT_NOSAVE
|
|
||||||
#define CONF_PRE_PARSE M_OPT_PRE_PARSE
|
#define CONF_PRE_PARSE M_OPT_PRE_PARSE
|
||||||
|
|
||||||
// These flags are used to describe special parser capabilities or behavior.
|
// These flags are used to describe special parser capabilities or behavior.
|
||||||
|
Loading…
Reference in New Issue
Block a user