summaryrefslogtreecommitdiffstats
path: root/parser-mpcmd.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-26 10:44:59 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-26 10:44:59 +0300
commitfb33e286b5c23dbe8d0aeaf63cd3490bed3906e3 (patch)
tree9e1eb90e7ec461afd59c3411c2be253b75a9f448 /parser-mpcmd.c
parent6be229cbbfbe29ad61025051b1d903f5619e0b8a (diff)
downloadmpv-fb33e286b5c23dbe8d0aeaf63cd3490bed3906e3.tar.bz2
mpv-fb33e286b5c23dbe8d0aeaf63cd3490bed3906e3.tar.xz
Move global mconfig to mpctx
The global was used in the function cfg_include which handles the -include option. Make the address available in that function by creating a new dynamically allocated option in m_config_new that has the address in the option's private data. asxparser.c also used the global. Making it available through all ways the code could get called required a number of relatively straightforward changes to playtree and menu code.
Diffstat (limited to 'parser-mpcmd.c')
-rw-r--r--parser-mpcmd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/parser-mpcmd.c b/parser-mpcmd.c
index 8e5da2cb98..cba28e538a 100644
--- a/parser-mpcmd.c
+++ b/parser-mpcmd.c
@@ -33,7 +33,9 @@ static int mode = 0;
// #define UNSET_GLOBAL (mode = GLOBAL)
-static int is_entry_option(char *opt, char *param, play_tree_t** ret) {
+static int is_entry_option(struct m_config *mconfig, char *opt, char *param,
+ play_tree_t** ret)
+{
play_tree_t* entry = NULL;
*ret = NULL;
@@ -42,7 +44,7 @@ static int is_entry_option(char *opt, char *param, play_tree_t** ret) {
if(!param)
return M_OPT_MISSING_PARAM;
- entry = parse_playlist_file(param);
+ entry = parse_playlist_file(mconfig, param);
if(!entry)
return -1;
else {
@@ -174,7 +176,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
const m_option_t* mp_opt = NULL;
play_tree_t* entry = NULL;
- tmp = is_entry_option(opt,(i+1<argc) ? argv[i + 1] : NULL,&entry);
+ tmp = is_entry_option(config, opt,(i+1<argc) ? argv[i + 1] : NULL,&entry);
if(tmp > 0) { // It's an entry
if(entry) {
add_entry(&last_parent,&last_entry,entry);