comparison mencoder.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 aa0c534db455
children cc7c52fa5eb1
comparison
equal deleted inserted replaced
26407:7451ffea2efb 26408:7a36d5941fd8
406 406
407 user_correct_pts = 0; 407 user_correct_pts = 0;
408 408
409 mp_msg_init(); 409 mp_msg_init();
410 410
411 for(i=1; i<argc; i++) 411 // Create the config context and register the options
412 if(!strcmp(argv[i], "-really-quiet")) 412 mconfig = m_config_new();
413 verbose= -10; 413 m_config_register_options(mconfig,mencoder_opts);
414
415 // Preparse the command line
416 m_config_preparse_command_line(mconfig,argc,argv);
414 417
415 mp_msg(MSGT_CPLAYER,MSGL_INFO, "MEncoder " VERSION " (C) 2000-2008 MPlayer Team\n"); 418 mp_msg(MSGT_CPLAYER,MSGL_INFO, "MEncoder " VERSION " (C) 2000-2008 MPlayer Team\n");
416 419
417 /* Test for cpu capabilities (and corresponding OS support) for optimizing */ 420 /* Test for cpu capabilities (and corresponding OS support) for optimizing */
418 GetCpuCaps(&gCpuCaps); 421 GetCpuCaps(&gCpuCaps);
463 mp_msg(MSGT_MENCODER,MSGL_V,MSGTR_BuiltinCodecsConf); 466 mp_msg(MSGT_MENCODER,MSGL_V,MSGTR_BuiltinCodecsConf);
464 } 467 }
465 } 468 }
466 } 469 }
467 470
468 mconfig = m_config_new();
469 m_config_register_options(mconfig,mencoder_opts);
470 parse_cfgfiles(mconfig); 471 parse_cfgfiles(mconfig);
471 filelist = m_config_parse_me_command_line(mconfig, argc, argv); 472 filelist = m_config_parse_me_command_line(mconfig, argc, argv);
472 if(!filelist) mencoder_exit(1, MSGTR_ErrorParsingCommandLine); 473 if(!filelist) mencoder_exit(1, MSGTR_ErrorParsingCommandLine);
473 474
474 { 475 {