diff mplayer.c @ 26408:7a36d5941fd8

Replace the trivial command line preparser with a more robust version allowing all kind of options to be used.
author albeu
date Sun, 13 Apr 2008 19:18:51 +0000
parents 5bfc1d8bece9
children 9d53b15aed02
line wrap: on
line diff
--- a/mplayer.c	Sun Apr 13 11:15:08 2008 +0000
+++ b/mplayer.c	Sun Apr 13 19:18:51 2008 +0000
@@ -2554,9 +2554,13 @@
   
   mp_msg_init();
 
-  for(i=1; i<argc; i++)
-    if(!strcmp(argv[i], "-really-quiet"))
-      verbose= -10;
+  // Create the config context and register the options
+  mconfig = m_config_new();
+  m_config_register_options(mconfig,mplayer_opts);
+  mp_input_register_options(mconfig);
+
+  // Preparse the command line
+  m_config_preparse_command_line(mconfig,argc,argv);
 
   print_version();
 #if defined(WIN32) && defined(USE_WIN32DLL)
@@ -2582,10 +2586,6 @@
           use_gui=1;
   }
 
-    mconfig = m_config_new();
-    m_config_register_options(mconfig,mplayer_opts);
-    // TODO : add something to let modules register their options
-    mp_input_register_options(mconfig);
     parse_cfgfiles(mconfig);
 
 #ifdef HAVE_NEW_GUI