diff options
author | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-11-12 01:56:42 +0000 |
---|---|---|
committer | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-11-12 01:56:42 +0000 |
commit | 126725660d4bebbab8570221c5681dc01d98fe86 (patch) | |
tree | 3ebdca9acf6fae38bfdba5b4159fbd16177da828 /mencoder.c | |
parent | 0f622e2d6fe735d727b9d8fd12cea22e03fd954b (diff) | |
download | mpv-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 'mencoder.c')
-rw-r--r-- | mencoder.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/mencoder.c b/mencoder.c index ff7989a06a..60e0d85f39 100644 --- a/mencoder.c +++ b/mencoder.c @@ -33,7 +33,14 @@ static char* banner_text= #include "cpudetect.h" #include "codec-cfg.h" +#ifdef NEW_CONFIG +#include "m_option.h" +#include "m_config.h" +#include "parser-mecmd.h" +#else #include "cfgparser.h" +#include "playtree.h" +#endif #include "libmpdemux/stream.h" #include "libmpdemux/demuxer.h" @@ -41,7 +48,6 @@ static char* banner_text= #include "libmpdemux/mp3_hdr.h" #include "libmpdemux/aviwrite.h" -#include "playtree.h" #include "libvo/video_out.h" @@ -196,6 +202,12 @@ float lame_param_scale=-1; // unset m_config_t* mconfig; +#ifdef NEW_CONFIG +extern int +m_config_parse_config_file(m_config_t* config, char *conffile); +#endif + + static int cfg_inc_verbose(struct config *conf){ ++verbose; return 0;} static int cfg_include(struct config *conf, char *filename){ @@ -326,8 +338,12 @@ lame_global_flags *lame; double v_pts_corr=0; double v_timer_corr=0; +#ifdef NEW_CONFIG +m_entry_t* filelist = NULL; +#else play_tree_t* playtree; play_tree_iter_t* playtree_iter; +#endif char* filename=NULL; char* frameno_filename="frameno.avi"; @@ -357,13 +373,24 @@ if(!parse_codec_cfg(get_path("codecs.conf"))){ } } - // FIXME: get rid of -dvd and other tricky options and config/playtree + // FIXME: get rid of -dvd and other tricky options stream2=open_stream(frameno_filename,0,&i); if(stream2){ demuxer2=demux_open(stream2,DEMUXER_TYPE_AVI,-1,-1,-2); if(demuxer2) printf(MSGTR_UsingPass3ControllFile,frameno_filename); } + // New config code +#ifdef NEW_CONFIG + mconfig = m_config_new(); + m_config_register_options(mconfig,mencoder_opts); + parse_cfgfiles(mconfig); + filelist = m_config_parse_me_command_line(mconfig, argc, argv); + if(!filelist) mencoder_exit(1, "error parsing cmdline"); + m_entry_set_options(mconfig,&filelist[0]); + filename = filelist[0].name; + // Warn the user if he put more than 1 filename ? +#else playtree = play_tree_new(); mconfig = m_config_new(playtree); m_config_register_options(mconfig,mencoder_opts); @@ -381,6 +408,7 @@ if(!parse_codec_cfg(get_path("codecs.conf"))){ filename = play_tree_iter_get_file(playtree_iter,1); } } +#endif if(!filename && !vcd_track && !dvd_title && !tv_param_on){ printf(MSGTR_MissingFilename); |