comparison 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
comparison
equal deleted inserted replaced
26407:7451ffea2efb 26408:7a36d5941fd8
2552 2552
2553 InitTimer(); 2553 InitTimer();
2554 2554
2555 mp_msg_init(); 2555 mp_msg_init();
2556 2556
2557 for(i=1; i<argc; i++) 2557 // Create the config context and register the options
2558 if(!strcmp(argv[i], "-really-quiet")) 2558 mconfig = m_config_new();
2559 verbose= -10; 2559 m_config_register_options(mconfig,mplayer_opts);
2560 mp_input_register_options(mconfig);
2561
2562 // Preparse the command line
2563 m_config_preparse_command_line(mconfig,argc,argv);
2560 2564
2561 print_version(); 2565 print_version();
2562 #if defined(WIN32) && defined(USE_WIN32DLL) 2566 #if defined(WIN32) && defined(USE_WIN32DLL)
2563 set_path_env(); 2567 set_path_env();
2564 #endif /*WIN32 && USE_WIN32DLL*/ 2568 #endif /*WIN32 && USE_WIN32DLL*/
2580 base = argv[0]; 2584 base = argv[0];
2581 if(strstr(base, "gmplayer")) 2585 if(strstr(base, "gmplayer"))
2582 use_gui=1; 2586 use_gui=1;
2583 } 2587 }
2584 2588
2585 mconfig = m_config_new();
2586 m_config_register_options(mconfig,mplayer_opts);
2587 // TODO : add something to let modules register their options
2588 mp_input_register_options(mconfig);
2589 parse_cfgfiles(mconfig); 2589 parse_cfgfiles(mconfig);
2590 2590
2591 #ifdef HAVE_NEW_GUI 2591 #ifdef HAVE_NEW_GUI
2592 if ( use_gui ) cfg_read(); 2592 if ( use_gui ) cfg_read();
2593 #endif 2593 #endif