mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
options: remove --vf-defaults and --af-defaults
These were deprecated a long time ago and apparently didn't even work with lavfi filters. Go ahead and remove them and additionally clean up some code related to them. m_config_from_obj_desc_and_args becomes much simpler now and a couple of arguments can be completely removed.
This commit is contained in:
@@ -168,18 +168,9 @@ static int m_config_set_obj_params(struct m_config *config, struct mp_log *log,
|
||||
|
||||
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)
|
||||
char **args)
|
||||
{
|
||||
struct m_config *config = m_config_from_obj_desc(ta_parent, log, global, desc);
|
||||
|
||||
for (int n = 0; defaults && defaults[n].name; n++) {
|
||||
struct m_obj_settings *entry = &defaults[n];
|
||||
if (name && strcmp(entry->name, name) == 0) {
|
||||
if (m_config_set_obj_params(config, log, global, desc, entry->attribs) < 0)
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_config_set_obj_params(config, log, global, desc, args) < 0)
|
||||
goto error;
|
||||
|
||||
|
||||
@@ -115,10 +115,9 @@ struct m_config *m_config_new(void *talloc_ctx, struct mp_log *log,
|
||||
// different sub-options for every filter (represented by separate desc
|
||||
// structs).
|
||||
// args is an array of key/value pairs (args=[k0, v0, k1, v1, ..., NULL]).
|
||||
// name/defaults is only needed for the legacy af-defaults/vf-defaults options.
|
||||
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);
|
||||
char **args);
|
||||
|
||||
// Like m_config_from_obj_desc_and_args(), but don't allocate option the
|
||||
// struct, i.e. m_config.optstruct==NULL. This is used by the sub-option
|
||||
|
||||
@@ -574,11 +574,7 @@ static const m_option_t mp_opts[] = {
|
||||
|
||||
// ------------------------- codec/vfilter options --------------------
|
||||
|
||||
{"af-defaults", OPT_SETTINGSLIST(af_defs, &af_obj_list),
|
||||
.deprecation_message = "use --af + enable/disable flags"},
|
||||
{"af", OPT_SETTINGSLIST(af_settings, &af_obj_list)},
|
||||
{"vf-defaults", OPT_SETTINGSLIST(vf_defs, &vf_obj_list),
|
||||
.deprecation_message = "use --vf + enable/disable flags"},
|
||||
{"vf", OPT_SETTINGSLIST(vf_settings, &vf_obj_list)},
|
||||
|
||||
{"", OPT_SUBSTRUCT(filter_opts, filter_conf)},
|
||||
|
||||
@@ -299,8 +299,8 @@ typedef struct MPOpts {
|
||||
int force_srate;
|
||||
double playback_speed;
|
||||
bool pitch_correction;
|
||||
struct m_obj_settings *vf_settings, *vf_defs;
|
||||
struct m_obj_settings *af_settings, *af_defs;
|
||||
struct m_obj_settings *vf_settings;
|
||||
struct m_obj_settings *af_settings;
|
||||
struct filter_opts *filter_opts;
|
||||
struct dec_wrapper_opts *dec_wrapper;
|
||||
char **sub_name;
|
||||
|
||||
Reference in New Issue
Block a user