From d4d62bbc657d3e5105336642fff1d58f6e7d15d8 Mon Sep 17 00:00:00 2001 From: albeu Date: Tue, 24 Jan 2006 11:16:13 +0000 Subject: Profiles support. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17472 b3059339-0415-0410-9bf9-f77b7e298cf2 --- parser-cfg.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'parser-cfg.c') 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) { -- cgit v1.2.3