summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-18 17:01:25 +0100
committerwm4 <wm4@nowhere>2013-02-18 17:01:25 +0100
commit41763b6d5626a66b063e016200c68fed2adb5e63 (patch)
tree7a21c490af04992eb34b4e4bb0cc593a08cb406b /core
parent187903ef31da4029b9810e1ac910f8d1887667c1 (diff)
downloadmpv-41763b6d5626a66b063e016200c68fed2adb5e63.tar.bz2
mpv-41763b6d5626a66b063e016200c68fed2adb5e63.tar.xz
parser-cfg: fix profile-desc
Printed "error parsing option profile-desc=..." when using that inside of profile sections. This happened because we now check the presence of an option before setting it, and profile-desc is not an option, but special cased in the config parser.
Diffstat (limited to 'core')
-rw-r--r--core/parser-cfg.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/parser-cfg.c b/core/parser-cfg.c
index 5d63d27c52..8f90d3f5e6 100644
--- a/core/parser-cfg.c
+++ b/core/parser-cfg.c
@@ -200,6 +200,11 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile)
bstr bopt = bstr0(opt);
bstr bparam = bstr0(param);
+ if (profile && bstr_equals0(bopt, "profile-desc")) {
+ m_profile_set_desc(profile, param);
+ goto nextline;
+ }
+
tmp = m_config_option_requires_param(config, bopt);
if (tmp > 0 && !param_set)
tmp = M_OPT_MISSING_PARAM;
@@ -212,11 +217,7 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile)
}
if (profile) {
- if (!strcmp(opt, "profile-desc"))
- m_profile_set_desc(profile, param);
- else
- tmp = m_config_set_profile_option(config, profile,
- bopt, bparam);
+ tmp = m_config_set_profile_option(config, profile, bopt, bparam);
} else {
tmp = m_config_set_option_ext(config, bopt, bparam,
M_SETOPT_FROM_CONFIG_FILE);