diff options
Diffstat (limited to 'options')
-rw-r--r-- | options/m_config.c | 273 | ||||
-rw-r--r-- | options/m_config.h | 9 | ||||
-rw-r--r-- | options/m_option.c | 75 | ||||
-rw-r--r-- | options/m_option.h | 34 | ||||
-rw-r--r-- | options/options.c | 12 | ||||
-rw-r--r-- | options/options.h | 5 |
6 files changed, 147 insertions, 261 deletions
diff --git a/options/m_config.c b/options/m_config.c index 1c5fe01293..14aa56da51 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -29,16 +29,13 @@ #include <stdbool.h> #include <pthread.h> -#if HAVE_FNMATCH -#include <fnmatch.h> -#endif - #include "libmpv/client.h" #include "mpv_talloc.h" #include "m_config.h" #include "options/m_option.h" +#include "common/common.h" #include "common/global.h" #include "common/msg.h" #include "common/msg_control.h" @@ -268,6 +265,39 @@ struct m_config *m_config_from_obj_desc_noalloc(void *talloc_ctx, return m_config_new(talloc_ctx, log, 0, desc->priv_defaults, desc->options); } +static struct m_config_group *find_group(struct mpv_global *global, + const struct m_option *cfg) +{ + struct m_config_shadow *shadow = global->config; + struct m_config *root = shadow->root; + + for (int n = 0; n < root->num_groups; n++) { + if (cfg && root->groups[n].group && root->groups[n].group->opts == cfg) + return &root->groups[n]; + } + + return NULL; +} + +// Allocate a priv struct that is backed by global options (like AOs and VOs, +// anything that uses m_obj_list.use_global_options == true). +// The result contains a snapshot of the current option values of desc->options. +// For convenience, desc->options can be NULL; then priv struct is allocated +// with just zero (or priv_defaults if set). +void *m_config_group_from_desc(void *ta_parent, struct mp_log *log, + struct mpv_global *global, struct m_obj_desc *desc, const char *name) +{ + struct m_config_group *group = find_group(global, desc->options); + if (group) { + return mp_get_config_group(ta_parent, global, group->group); + } else { + void *d = talloc_zero_size(ta_parent, desc->priv_size); + if (desc->priv_defaults) + memcpy(d, desc->priv_defaults, desc->priv_size); + return d; + } +} + static struct m_config_option *m_config_find_negation_opt(struct m_config *config, struct bstr *name); @@ -277,40 +307,8 @@ static int m_config_set_obj_params(struct m_config *config, struct mp_log *log, { for (int n = 0; args && args[n * 2 + 0]; n++) { bstr opt = bstr0(args[n * 2 + 0]); - const char *val = args[n * 2 + 1]; - struct m_config_option *co = m_config_get_co(config, opt); - if (!co) { - co = m_config_find_negation_opt(config, &opt); - if (!co) - continue; - - if (val && val[0]) - return -1; // no parameter allowed - - val = "no"; - } - struct m_config *target = config; - bool is_legacy = co->opt->type == &m_option_type_subopt_legacy; - bool force_legacy = !!desc->legacy_prefix; - if (is_legacy || force_legacy) { - // Legacy: redirect deprecated sub-options to global ones. - char tmp[100]; - const char *newopt; - if (is_legacy) { - newopt = co->opt->priv; - } else { - snprintf(tmp, sizeof(tmp), "%s-%.*s", desc->legacy_prefix, - BSTR_P(opt)); - newopt = tmp; - } - assert(global); - target = mp_get_root_config(global); - mp_warn(log, "Using suboptions is deprecated. Use the global '--%s' " - "option instead of '%.*s' suboption.\n", newopt, - BSTR_P(opt)); - opt = bstr0(newopt); - } - if (m_config_set_option(target, opt, bstr0(val)) < 0) + bstr val = bstr0(args[n * 2 + 1]); + if (m_config_set_option(config, opt, val) < 0) return -1; } @@ -334,21 +332,6 @@ struct m_config *m_config_from_obj_desc_and_args(void *ta_parent, if (m_config_set_obj_params(config, log, global, desc, args) < 0) goto error; - if (desc->legacy_prefix) { - assert(global); - struct m_config *root = mp_get_root_config(global); - // In this mode, the AO/VO will still access the options via its priv - // struct (like with real sub-options). We have to copy them over. - for (int n = 0; n < config->num_opts; n++) { - struct m_config_option *co = &config->opts[n]; - char opt[100]; - snprintf(opt, sizeof(opt), "%s-%s", desc->legacy_prefix, co->name); - struct m_config_option *g = m_config_get_co_raw(root, bstr0(opt)); - assert(g); - m_option_copy(co->opt, co->data, g->data); - } - } - return config; error: talloc_free(config); @@ -357,8 +340,6 @@ error: static void ensure_backup(struct m_config *config, struct m_config_option *co) { - if (co->opt->type->flags & M_OPT_TYPE_HAS_CHILD) - return; if (!co->data) return; for (struct m_opt_backup *cur = config->backup_opts; cur; cur = cur->next) { @@ -457,34 +438,83 @@ static void add_sub_options(struct m_config *config, }; struct m_config_option next = { - .name = parent ? parent->name : "", + .name = "", .group = group, }; + if (parent && parent->name && parent->name[0]) + next.name = parent->name; + if (subopts->prefix && subopts->prefix[0]) { + assert(next.name); + next.name = subopts->prefix; + } add_options(config, &next, new_optstruct, new_optstruct_def, subopts->opts); } -static void add_global_subopts(struct m_config *config, - const struct m_obj_list *list) +#define MAX_VO_AO 16 + +struct group_entry { + const struct m_obj_list *entry; + struct m_sub_options subs[MAX_VO_AO]; + bool initialized; +}; + +static struct group_entry g_groups[2]; // limited by max. m_obj_list overall +static int g_num_groups = 0; +static pthread_mutex_t g_group_mutex = PTHREAD_MUTEX_INITIALIZER; + +static const struct m_sub_options *get_cached_group(const struct m_obj_list *list, + int n, struct m_sub_options *v) +{ + pthread_mutex_lock(&g_group_mutex); + + struct group_entry *group = NULL; + for (int i = 0; i < g_num_groups; i++) { + if (g_groups[i].entry == list) { + group = &g_groups[i]; + break; + } + } + if (!group) { + assert(g_num_groups < MP_ARRAY_SIZE(g_groups)); + group = &g_groups[g_num_groups++]; + group->entry = list; + } + + if (!group->initialized) { + if (!v) { + n = -1; + group->initialized = true; + } else { + assert(n < MAX_VO_AO); // simply increase this if it fails + group->subs[n] = *v; + } + } + + pthread_mutex_unlock(&g_group_mutex); + + return n >= 0 ? &group->subs[n] : NULL; +} + +static void init_obj_settings_list(struct m_config *config, + const struct m_obj_list *list) { struct m_obj_desc desc; for (int n = 0; ; n++) { - if (!list->get_desc(&desc, n)) + if (!list->get_desc(&desc, n)) { + if (list->use_global_options) + get_cached_group(list, n, NULL); break; + } if (desc.global_opts) add_sub_options(config, NULL, desc.global_opts); - if (desc.legacy_prefix && desc.options) { - // Legacy: auto-add sub-options as global options (using the prefix). - struct m_config_option parent = { - .name = desc.legacy_prefix, - .group = 0, - }; - struct m_sub_options *conf = talloc(config, struct m_sub_options); - *conf = (struct m_sub_options){ + if (list->use_global_options && desc.options) { + struct m_sub_options conf = { + .prefix = desc.options_prefix, .opts = desc.options, .defaults = desc.priv_defaults, .size = desc.priv_size, }; - add_sub_options(config, &parent, conf); + add_sub_options(config, NULL, get_cached_group(list, n, &conf)); } } } @@ -517,6 +547,8 @@ static void m_config_add_option(struct m_config *config, .name = arg->name, .shadow_offset = -1, .group = parent ? parent->group : 0, + .default_data = &default_value, + .is_hidden = !!arg->deprecation_message, }; if (arg->offset >= 0) { @@ -524,22 +556,11 @@ static void m_config_add_option(struct m_config *config, co.data = (char *)optstruct + arg->offset; if (optstruct_def) co.default_data = (char *)optstruct_def + arg->offset; - int size = arg->type->size; - if (optstruct && size) { - // The required alignment is unknown, so go with the minimum C - // could require. Slightly wasteful, but not that much. - int align = (size - config->shadow_size % size) % size; - co.shadow_offset = config->shadow_size + align; - config->shadow_size = co.shadow_offset + size; - } } if (arg->defval) co.default_data = arg->defval; - if (!co.default_data) - co.default_data = &default_value; - // Fill in the full name if (!co.name[0]) { co.name = parent_name; @@ -547,25 +568,28 @@ static void m_config_add_option(struct m_config *config, co.name = talloc_asprintf(config, "%s-%s", parent_name, co.name); } - if (co.opt->deprecation_message) - co.is_hidden = true; - - // Option with children -> add them - if (arg->type->flags & M_OPT_TYPE_HAS_CHILD) { + if (arg->type == &m_option_type_subconfig) { const struct m_sub_options *subopts = arg->priv; add_sub_options(config, &co, subopts); } else { + int size = arg->type->size; + if (optstruct && size) { + // The required alignment is unknown, so go with the maximum C + // could require. Slightly wasteful, but not that much. + int align = (size - config->shadow_size % size) % size; + co.shadow_offset = config->shadow_size + align; + config->shadow_size = co.shadow_offset + size; + } + // Initialize options if (co.data && co.default_data) init_opt_inplace(arg, co.data, co.default_data); - } - // (The deprecation_message check is a hack to exclude --vo-defaults etc.) - if (arg->type == &m_option_type_obj_settings_list && !arg->deprecation_message) - add_global_subopts(config, (const struct m_obj_list *)arg->priv); - - if (arg->name[0]) // no own name -> hidden MP_TARRAY_APPEND(config, config->opts, config->num_opts, co); + + if (arg->type == &m_option_type_obj_settings_list) + init_obj_settings_list(config, (const struct m_obj_list *)arg->priv); + } } struct m_config_option *m_config_get_co_raw(const struct m_config *config, @@ -745,9 +769,6 @@ int m_config_set_option_raw(struct m_config *config, struct m_config_option *co, } } -static int parse_subopts(struct m_config *config, char *name, char *prefix, - struct bstr param, int flags); - // Used to turn "--no-foo" into "--foo=no". static struct m_config_option *m_config_find_negation_opt(struct m_config *config, struct bstr *name) @@ -811,22 +832,9 @@ static int m_config_parse_option(struct m_config *config, struct bstr name, if (bstr_equals0(name, "list-options")) return list_options(config, bstr0("*"), false); - // Option with children are a bit different to parse - if (co->opt->type->flags & M_OPT_TYPE_HAS_CHILD) { - char prefix[110]; - if (!config->subopt_deprecation_warning) { - MP_WARN(config, "Suboptions (--%.*s=...) are deprecated. Use " - "flat options instead.\n", BSTR_P(name)); - config->subopt_deprecation_warning = true; - } - assert(strlen(co->name) < 100); - sprintf(prefix, "%s-", co->name); - return parse_subopts(config, (char *)co->name, prefix, param, flags); - } - union m_option_value val = {0}; - // Some option tpyes are "impure" and work on the existing data. + // Some option types are "impure" and work on the existing data. // (Prime examples: --vf-add, --sub-file) if (co->data) m_option_copy(co->opt, &val, co->data); @@ -841,48 +849,6 @@ static int m_config_parse_option(struct m_config *config, struct bstr name, return r; } -static int parse_subopts(struct m_config *config, char *name, char *prefix, - struct bstr param, int flags) -{ - char **lst = NULL; - // Split the argument into child options - int r = m_option_type_subconfig.parse(config->log, NULL, bstr0(""), param, &lst); - if (r < 0) - return r; - // Parse the child options - for (int i = 0; lst && lst[2 * i]; i++) { - // Build the full name - char n[110]; - if (snprintf(n, 110, "%s%s", prefix, lst[2 * i]) > 100) - abort(); - r = m_config_parse_option(config,bstr0(n), bstr0(lst[2 * i + 1]), flags); - if (r < 0) { - if (r != M_OPT_EXIT) { - MP_ERR(config, "Error parsing suboption %s/%s (%s)\n", - name, lst[2 * i], m_option_strerror(r)); - r = M_OPT_INVALID; - } - break; - } - } - talloc_free(lst); - return r; -} - -int m_config_parse_suboptions(struct m_config *config, char *name, - char *subopts) -{ - if (!subopts || !*subopts) - return 0; - int r = parse_subopts(config, name, "", bstr0(subopts), 0); - if (r < 0 && r != M_OPT_EXIT) { - MP_ERR(config, "Error parsing suboption %s (%s)\n", - name, m_option_strerror(r)); - r = M_OPT_INVALID; - } - return r; -} - int m_config_set_option_ext(struct m_config *config, struct bstr name, struct bstr param, int flags) { @@ -984,14 +950,10 @@ void m_config_print_option_list(const struct m_config *config, const char *name) for (int i = 0; i < config->num_opts; i++) { struct m_config_option *co = &sorted[i]; const struct m_option *opt = co->opt; - if (opt->type->flags & M_OPT_TYPE_HAS_CHILD) - continue; if (co->is_hidden) continue; -#if HAVE_FNMATCH - if (fnmatch(name, co->name, 0)) + if (strcmp(name, "*") != 0 && !strstr(co->name, name)) continue; -#endif MP_INFO(config, " %s%-30s", prefix, co->name); if (opt->type == &m_option_type_choice) { MP_INFO(config, " Choices:"); @@ -1038,9 +1000,6 @@ char **m_config_list_options(void *ta_parent, const struct m_config *config) int count = 0; for (int i = 0; i < config->num_opts; i++) { struct m_config_option *co = &config->opts[i]; - const struct m_option *opt = co->opt; - if (opt->type->flags & M_OPT_TYPE_HAS_CHILD) - continue; if (co->is_hidden) continue; // For use with CONF_TYPE_STRING_LIST, it's important not to set list diff --git a/options/m_config.h b/options/m_config.h index 94a6c9e6ee..1e199cacd9 100644 --- a/options/m_config.h +++ b/options/m_config.h @@ -92,8 +92,6 @@ typedef struct m_config { // For the command line parser int recursion_depth; - bool subopt_deprecation_warning; - void *optstruct; // struct mpopts or other int shadow_size; @@ -136,6 +134,9 @@ struct m_config *m_config_from_obj_desc_and_args(void *ta_parent, struct mp_log *log, struct mpv_global *global, struct m_obj_desc *desc, const char *name, struct m_obj_settings *defaults, char **args); +void *m_config_group_from_desc(void *ta_parent, struct mp_log *log, + struct mpv_global *global, struct m_obj_desc *desc, const char *name); + // Make sure the option is backed up. If it's already backed up, do nothing. // All backed up options can be restored with m_config_restore_backups(). void m_config_backup_opt(struct m_config *config, const char *opt); @@ -197,10 +198,6 @@ struct mpv_node; int m_config_set_option_node(struct m_config *config, bstr name, struct mpv_node *data, int flags); - -int m_config_parse_suboptions(struct m_config *config, char *name, - char *subopts); - struct m_config_option *m_config_get_co_raw(const struct m_config *config, struct bstr name); struct m_config_option *m_config_get_co(const struct m_config *config, diff --git a/options/m_option.c b/options/m_option.c index 4ef5481ceb..11bb677b97 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1662,10 +1662,7 @@ const m_option_type_t m_option_type_print_fn = { .parse = parse_print, }; - -/////////////////////// Subconfig #undef VAL -#define VAL(x) (*(char ***)(x)) // Read s sub-option name, or a positional sub-opt value. // termset is a string containing the set of chars that terminate an option. @@ -1750,50 +1747,6 @@ static int split_subconf(struct mp_log *log, bstr optname, bstr *str, return 0; } -static int parse_subconf(struct mp_log *log, const m_option_t *opt, - struct bstr name, struct bstr param, void *dst) -{ - int nr = 0; - char **lst = NULL; - - if (param.len == 0) - return M_OPT_MISSING_PARAM; - - struct bstr p = param; - - while (p.len) { - bstr subopt, subparam; - int r = split_subconf(log, name, &p, &subopt, &subparam); - if (r < 0) - return r; - if (bstr_startswith0(p, ":")) - p = bstr_cut(p, 1); - else if (p.len > 0) { - mp_err(log, "Incorrect termination for '%.*s'\n", BSTR_P(subopt)); - return M_OPT_INVALID; - } - - if (dst) { - lst = talloc_realloc(NULL, lst, char *, 2 * (nr + 2)); - lst[2 * nr] = bstrto0(lst, subopt); - lst[2 * nr + 1] = bstrto0(lst, subparam); - memset(&lst[2 * (nr + 1)], 0, 2 * sizeof(char *)); - nr++; - } - } - - if (dst) - VAL(dst) = lst; - - return 1; -} - -const m_option_type_t m_option_type_subconfig = { - .name = "Subconfig", - .flags = M_OPT_TYPE_HAS_CHILD, - .parse = parse_subconf, -}; - #undef VAL // Split the string on the given split character. @@ -2719,7 +2672,8 @@ static int get_obj_param(struct mp_log *log, bstr opt_name, bstr obj_name, static int m_obj_parse_sub_config(struct mp_log *log, struct bstr opt_name, struct bstr name, struct bstr *pstr, struct m_config *config, int flags, bool nopos, - struct m_obj_desc *desc, char ***ret) + struct m_obj_desc *desc, + const struct m_obj_list *list, char ***ret) { int nold = 0; char **args = NULL; @@ -2737,6 +2691,16 @@ static int m_obj_parse_sub_config(struct mp_log *log, struct bstr opt_name, r = split_subconf(log, opt_name, pstr, &fname, &fval); if (r < 0) goto exit; + + if (list->use_global_options) { + mp_err(log, "Option %.*s: this option does not accept sub-options.\n", + BSTR_P(opt_name)); + mp_err(log, "Sub-options for --vo and --ao were removed from mpv in " + "release 0.23.0.\nSee https://0x0.st/uM for details.\n"); + r = M_OPT_INVALID; + goto exit; + } + if (bstr_equals0(fname, "help")) goto print_help; r = get_obj_param(log, opt_name, name, config, fname, fval, flags, @@ -2831,7 +2795,7 @@ static int parse_obj_settings(struct mp_log *log, struct bstr opt, struct m_config *config = m_config_from_obj_desc_noalloc(NULL, log, &desc); bstr s = bstr0(desc.init_options); m_obj_parse_sub_config(log, opt, str, &s, config, - M_SETOPT_CHECK_ONLY, nopos, NULL, &plist); + M_SETOPT_CHECK_ONLY, nopos, NULL, list, &plist); assert(s.len == 0); talloc_free(config); } @@ -2841,7 +2805,7 @@ static int parse_obj_settings(struct mp_log *log, struct bstr opt, if (!skip) config = m_config_from_obj_desc_noalloc(NULL, log, &desc); r = m_obj_parse_sub_config(log, opt, str, pstr, config, - M_SETOPT_CHECK_ONLY, nopos, &desc, + M_SETOPT_CHECK_ONLY, nopos, &desc, list, _ret ? &plist : NULL); talloc_free(config); if (r < 0) @@ -3359,13 +3323,6 @@ const m_option_type_t m_option_type_alias = { const m_option_type_t m_option_type_removed = { .name = "removed", }; - -static int parse_dummy(struct mp_log *log, const m_option_t *opt, - struct bstr name, struct bstr param, void *dst) -{ - return 1; -} -const m_option_type_t m_option_type_subopt_legacy = { - .name = "legacy suboption", - .parse = parse_dummy, +const m_option_type_t m_option_type_subconfig = { + .name = "Subconfig", }; diff --git a/options/m_option.h b/options/m_option.h index d784d8f54d..8709d20bb2 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -53,7 +53,6 @@ extern const m_option_type_t m_option_type_choice; extern const m_option_type_t m_option_type_flags; extern const m_option_type_t m_option_type_msglevels; extern const m_option_type_t m_option_type_print_fn; -extern const m_option_type_t m_option_type_subconfig; extern const m_option_type_t m_option_type_imgfmt; extern const m_option_type_t m_option_type_fourcc; extern const m_option_type_t m_option_type_afmt; @@ -63,11 +62,11 @@ extern const m_option_type_t m_option_type_size_box; extern const m_option_type_t m_option_type_channels; extern const m_option_type_t m_option_type_aspect; extern const m_option_type_t m_option_type_node; -extern const m_option_type_t m_option_type_subopt_legacy; // Used internally by m_config.c extern const m_option_type_t m_option_type_alias; extern const m_option_type_t m_option_type_removed; +extern const m_option_type_t m_option_type_subconfig; // Callback used by m_option_type_print_fn options. typedef void (*m_opt_print_fn)(struct mp_log *log); @@ -117,6 +116,8 @@ struct m_obj_desc { const void *priv_defaults; // Options which refer to members in the private struct const struct m_option *options; + // Prefix for each of the above options (none if NULL). + const char *options_prefix; // For free use by the implementer of m_obj_list.get_desc const void *p; // If not NULL, options which should be set before applying other options. @@ -132,10 +133,6 @@ struct m_obj_desc { const char *replaced_name; // For convenience: these are added as global command-line options. const struct m_sub_options *global_opts; - // Evil hack to essentially force-move .options to global_opts. All options - // will be added as global options with the given prefix, and using - // sub-options will be treated as deprecated and redirected. - const char *legacy_prefix; }; // Extra definition needed for \ref m_option_type_obj_settings_list options. @@ -151,6 +148,8 @@ struct m_obj_list { bool allow_unknown_entries; // This helps with confusing error messages if unknown flag options are used. bool disallow_positional_parameters; + // Each sub-item is backed by global options (for AOs and VOs). + bool use_global_options; }; // Find entry by name @@ -188,6 +187,7 @@ typedef int (*m_opt_string_validate_fn)(struct mp_log *log, const m_option_t *op // m_option.priv points to this if OPT_SUBSTRUCT is used struct m_sub_options { + const char *prefix; const struct m_option *opts; size_t size; const void *defaults; @@ -406,16 +406,6 @@ struct m_option { // These flags are used to describe special parser capabilities or behavior. -// Suboption parser flag. -/** When this flag is set, m_option::p should point to another m_option - * array. Only the parse function will be called. If dst is set, it should - * create/update an array of char* containg opt/val pairs. The options in - * the child array will then be set automatically by the \ref Config. - * Also note that suboptions may be directly accessed by using - * -option:subopt blah. - */ -#define M_OPT_TYPE_HAS_CHILD (1 << 0) - // Wildcard matching flag. /** If set the option type has a use for option names ending with a * * (used for -aa*), this only affects the option name matching. @@ -714,12 +704,6 @@ extern const char m_option_path_separator; .type = &m_option_type_subconfig, \ .priv = (void*)&subconf) -// Same as above, but for legacy suboption usage, which have no associated -// field (no actual data anywhere). -#define OPT_SUBSTRUCT_LEGACY(optname, subconf) \ - {.name = optname, .offset = -1, .type = &m_option_type_subconfig, \ - .priv = (void*)&subconf} - // Provide a another name for the option. #define OPT_ALIAS(optname, newname) \ {.name = optname, .type = &m_option_type_alias, .priv = newname, \ @@ -736,10 +720,4 @@ extern const char m_option_path_separator; {.name = optname, .type = &m_option_type_removed, .priv = msg, \ .deprecation_message = "", .offset = -1} -// Redirect a suboption (e.g. from --vo) to a global option. The redirection -// is handled as a special case instead of being applied automatically. -#define OPT_SUBOPT_LEGACY(optname, globalname) \ - {.name = optname, .type = &m_option_type_subopt_legacy, .priv = globalname, \ - .offset = -1} - #endif /* MPLAYER_M_OPTION_H */ diff --git a/options/options.c b/options/options.c index 442c29297a..f79df7d82f 100644 --- a/options/options.c +++ b/options/options.c @@ -150,8 +150,6 @@ const struct m_sub_options stream_cache_conf = { static const m_option_t mp_vo_opt_list[] = { OPT_SETTINGSLIST("vo", video_driver_list, 0, &vo_obj_list, ), - OPT_SETTINGSLIST("vo-defaults", vo_defs, 0, &vo_obj_list, - .deprecation_message = "deprecated, use global options"), OPT_CHOICE_C("hwdec-preload", hwdec_preload_api, 0, mp_hwdec_names), OPT_SUBSTRUCT("sws", sws_opts, sws_conf, 0), OPT_FLAG("taskbar-progress", taskbar_progress, 0), @@ -184,7 +182,6 @@ static const m_option_t mp_vo_opt_list[] = { ({"default", -1})), OPT_CHOICE_OR_INT("fs-screen", fsscreen_id, 0, 0, 32, ({"all", -2}, {"current", -1})), - OPT_FLAG("fs-black-out-screens", fs_black_out_screens, 0), OPT_FLAG("keepaspect", keepaspect, UPDATE_VIDEOPOS), OPT_FLAG("keepaspect-window", keepaspect_window, 0), OPT_FLAG("hidpi-window-scale", hidpi_window_scale, 0), @@ -225,7 +222,6 @@ const struct m_sub_options vo_sub_opts = { .window_scale = 1.0, .x11_bypass_compositor = 2, .mmcss_profile = "Playback", - .fullscreen = HAVE_RPI ? 1 : 0, }, }; @@ -430,7 +426,8 @@ const m_option_t mp_opts[] = { OPT_STRING("audio-spdif", audio_spdif, 0), - OPT_FLAG("ad-spdif-dtshd", dtshd, 0), + OPT_FLAG("ad-spdif-dtshd", dtshd, 0, + .deprecation_message = "use --audio-spdif instead"), OPT_CHOICE_C("hwdec", hwdec_api, 0, mp_hwdec_names), OPT_STRING("hwdec-codecs", hwdec_codecs, 0), @@ -510,8 +507,6 @@ const m_option_t mp_opts[] = { //---------------------- libao/libvo options ------------------------ OPT_SETTINGSLIST("ao", audio_driver_list, 0, &ao_obj_list, ), - OPT_SETTINGSLIST("ao-defaults", ao_defs, 0, &ao_obj_list, - .deprecation_message = "deprecated, use global options"), OPT_STRING("audio-device", audio_device, UPDATE_AUDIO), OPT_FLAG("audio-exclusive", audio_exclusive, UPDATE_AUDIO), OPT_STRING("audio-client-name", audio_client_name, UPDATE_AUDIO), @@ -801,6 +796,7 @@ const m_option_t mp_opts[] = { OPT_REPLACED("ass-shaper", "sub-ass-shaper"), OPT_REPLACED("ass-style-override", "sub-ass-style-override"), OPT_REPLACED("ass-scale-with-window", "sub-ass-scale-with-window"), + OPT_REMOVED("fs-black-out-screens", NULL), {0} }; @@ -809,7 +805,7 @@ const struct MPOpts mp_default_opts = { .use_terminal = 1, .msg_color = 1, .audio_driver_list = NULL, - .audio_decoders = "-spdif:*", // never select spdif by default + .audio_decoders = NULL, .video_decoders = NULL, .deinterlace = -1, .softvol = SOFTVOL_AUTO, diff --git a/options/options.h b/options/options.h index 4ddf9d1490..fc37e98f8a 100644 --- a/options/options.h +++ b/options/options.h @@ -7,7 +7,7 @@ #include "common/common.h" typedef struct mp_vo_opts { - struct m_obj_settings *video_driver_list, *vo_defs; + struct m_obj_settings *video_driver_list; int taskbar_progress; int ontop; @@ -18,7 +18,6 @@ typedef struct mp_vo_opts { int screen_id; int fsscreen_id; - int fs_black_out_screens; char *winname; int x11_netwm; int x11_bypass_compositor; @@ -90,7 +89,7 @@ typedef struct MPOpts { int auto_load_scripts; - struct m_obj_settings *audio_driver_list, *ao_defs; + struct m_obj_settings *audio_driver_list; char *audio_device; int audio_exclusive; char *audio_client_name; |