summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-11-12 01:56:42 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-11-12 01:56:42 +0000
commit126725660d4bebbab8570221c5681dc01d98fe86 (patch)
tree3ebdca9acf6fae38bfdba5b4159fbd16177da828 /mplayer.c
parent0f622e2d6fe735d727b9d8fd12cea22e03fd954b (diff)
downloadmpv-126725660d4bebbab8570221c5681dc01d98fe86.tar.bz2
mpv-126725660d4bebbab8570221c5681dc01d98fe86.tar.xz
New config system + cleanup of header inter dependency
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8165 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mplayer.c b/mplayer.c
index 96e676ac9b..e1ef711c82 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -26,7 +26,12 @@
#define HELP_MP_DEFINE_STATIC
#include "help_mp.h"
+#ifdef NEW_CONFIG
+#include "m_option.h"
+#include "m_config.h"
+#else
#include "cfgparser.h"
+#endif
#include "cfg-mplayer-def.h"
#ifdef USE_SUB
@@ -101,6 +106,13 @@ play_tree_t* playtree;
m_config_t* mconfig;
+#ifdef NEW_CONFIG
+extern play_tree_t*
+m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv);
+extern int
+m_config_parse_config_file(m_config_t* config, char *conffile);
+#endif
+
//**************************************************************************//
// Config file
//**************************************************************************//
@@ -584,9 +596,13 @@ int gui_no_filename=0;
(strrchr(argv[0],'/') && !strcmp(strrchr(argv[0],'/'),"/gmplayer") ) )
use_gui=1;
+#ifdef NEW_CONFIG
+ mconfig = m_config_new();
+#else
playtree = play_tree_new();
mconfig = m_config_new(playtree);
+#endif
m_config_register_options(mconfig,mplayer_opts);
// TODO : add something to let modules register their options
mp_input_register_options(mconfig);
@@ -596,7 +612,13 @@ int gui_no_filename=0;
if ( use_gui ) cfg_read();
#endif
+#ifdef NEW_CONFIG
+ playtree = m_config_parse_mp_command_line(mconfig, argc, argv);
+ if(playtree == NULL)
+ exit(1);
+#else
if(m_config_parse_command_line(mconfig, argc, argv) < 0) exit(1); // error parsing cmdline
+#endif
playtree = play_tree_cleanup(playtree);
if(playtree) {