summaryrefslogtreecommitdiffstats
path: root/parser-cfg.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-01-24 11:16:13 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-01-24 11:16:13 +0000
commitd4d62bbc657d3e5105336642fff1d58f6e7d15d8 (patch)
treed79fcb1cab91ee7914906c372ef446ad58052f74 /parser-cfg.c
parenteed2e8e82082f78b6b38af1531c91bff91d0246c (diff)
downloadmpv-d4d62bbc657d3e5105336642fff1d58f6e7d15d8.tar.bz2
mpv-d4d62bbc657d3e5105336642fff1d58f6e7d15d8.tar.xz
Profiles support.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17472 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'parser-cfg.c')
-rw-r--r--parser-cfg.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/parser-cfg.c b/parser-cfg.c
index 587a348e3c..529580caf9 100644
--- a/parser-cfg.c
+++ b/parser-cfg.c
@@ -37,6 +37,7 @@ int m_config_parse_config_file(m_config_t* config, char *conffile)
int ret = 1;
int errors = 0;
int prev_mode = config->mode;
+ m_profile_t* profile = NULL;
#ifdef MP_DEBUG
assert(config != NULL);
@@ -105,6 +106,16 @@ int m_config_parse_config_file(m_config_t* config, char *conffile)
continue;
}
opt[opt_pos] = '\0';
+
+ /* Profile declaration */
+ if(opt_pos > 2 && opt[0] == '[' && opt[opt_pos-1] == ']') {
+ opt[opt_pos-1] = '\0';
+ if(strcmp(opt+1,"default"))
+ profile = m_config_add_profile(config,opt+1);
+ else
+ profile = NULL;
+ continue;
+ }
#ifdef MP_DEBUG
PRINT_LINENUM;
@@ -184,7 +195,14 @@ int m_config_parse_config_file(m_config_t* config, char *conffile)
ret = -1;
}
- tmp = m_config_set_option(config, opt, param);
+ if(profile) {
+ if(!strcmp(opt,"profile-desc"))
+ m_profile_set_desc(profile,param), tmp = 1;
+ else
+ tmp = m_config_set_profile_option(config,profile,
+ opt,param);
+ } else
+ tmp = m_config_set_option(config, opt, param);
if (tmp < 0) {
PRINT_LINENUM;
if(tmp == M_OPT_UNKNOWN) {