1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-01 11:50:48 +00:00

m_config: don't override profile option if not required

The --profile top-level option is handled specially in m_config.c. But
this code also broke sub-options that happened to be named "profile"
(e.g. when trying to use "-af-add=bs2b=profile=cmoy"). Handle it
specially only if it's the top-level --profile option.
This commit is contained in:
wm4 2013-07-24 19:44:10 +02:00
parent 837377a6ce
commit 31c271f4ad
2 changed files with 4 additions and 1 deletions

View File

@ -253,6 +253,8 @@ struct m_config *m_config_new(void *optstruct,
config->includefunc = includefunc; config->includefunc = includefunc;
} }
config->use_profiles = true;
return config; return config;
} }
@ -542,7 +544,7 @@ static int m_config_parse_option(struct m_config *config, void *optstruct,
if (config->includefunc && !bstrcmp0(name, "include")) { if (config->includefunc && !bstrcmp0(name, "include")) {
return parse_include(config, param, set); return parse_include(config, param, set);
} else if (!bstrcmp0(name, "profile")) } else if (config->use_profiles && !bstrcmp0(name, "profile"))
return parse_profile(config, co->opt, name, param, set); return parse_profile(config, co->opt, name, param, set);
// Option with children are a bit different to parse // Option with children are a bit different to parse

View File

@ -87,6 +87,7 @@ typedef struct m_config {
void *optstruct; // struct mpopts or other void *optstruct; // struct mpopts or other
int (*includefunc)(struct m_config *conf, char *filename); int (*includefunc)(struct m_config *conf, char *filename);
bool use_profiles;
} m_config_t; } m_config_t;
// Create a new config object. // Create a new config object.