diff options
author | wm4 <wm4@nowhere> | 2016-09-02 19:24:12 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-02 21:21:47 +0200 |
commit | eb14b18a33973021c30124775513795b689cec27 (patch) | |
tree | f4f5bb3c63c962ec0ea6f9c398a97f951b8d4446 /options/parse_configfile.c | |
parent | 9770ce6c44cd26e7b9e5b525c3222281d32dcb6f (diff) | |
download | mpv-eb14b18a33973021c30124775513795b689cec27.tar.bz2 mpv-eb14b18a33973021c30124775513795b689cec27.tar.xz |
config: allow profile forward-references in default profile
This works by first parsing a config file into the default profile, and
applying it once parsing the whole file is finished.
This won't work across config files (not even if you include other
config files via "include=file.conf").
Diffstat (limited to 'options/parse_configfile.c')
-rw-r--r-- | options/parse_configfile.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/options/parse_configfile.c b/options/parse_configfile.c index 8ccf6579ba..e7c877349d 100644 --- a/options/parse_configfile.c +++ b/options/parse_configfile.c @@ -128,15 +128,11 @@ int m_config_parse(m_config_t *config, const char *location, bstr data, } int res; - if (profile) { - if (bstr_equals0(option, "profile-desc")) { - m_profile_set_desc(profile, value); - res = 0; - } else { - res = m_config_set_profile_option(config, profile, option, value); - } + if (bstr_equals0(option, "profile-desc")) { + m_profile_set_desc(profile, value); + res = 0; } else { - res = m_config_set_option_ext(config, option, value, flags); + res = m_config_set_profile_option(config, profile, option, value); } if (res < 0) { MP_ERR(config, "%s setting option %.*s='%.*s' failed.\n", @@ -154,6 +150,8 @@ int m_config_parse(m_config_t *config, const char *location, bstr data, } } + m_config_finish_default_profile(config, flags); + talloc_free(tmp); return 1; } |