changeset 4488:7e8910727e7a

config file support for mencoder
author rfelker
date Sat, 02 Feb 2002 23:39:53 +0000
parents e642ff2d5c6d
children 745cf5ba7117
files mencoder.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Sat Feb 02 23:38:35 2002 +0000
+++ b/mencoder.c	Sat Feb 02 23:39:53 2002 +0000
@@ -206,6 +206,18 @@
 #include "spudec.h"
 #endif
 
+void parse_cfgfiles( m_config_t* conf )
+{
+  char *conffile;
+  if ((conffile = get_path("mencoder")) == NULL) {
+    mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_GetpathProblem);
+  } else {
+    if (m_config_parse_config_file(conf, conffile) < 0)
+      exit(1);
+    free(conffile);
+  }
+}
+
 //---------------------------------------------------------------------------
 
 // mini dummy libvo:
@@ -399,6 +411,8 @@
   playtree = play_tree_new();
   mconfig = m_config_new(playtree);
   m_config_register_options(mconfig,mencoder_opts);
+  // TODO : add something to let modules register their options
+  parse_cfgfiles(mconfig);
 
   if(m_config_parse_command_line(mconfig, argc, argv, envp) < 0) exit(1); // error parsing cmdline
   playtree = play_tree_cleanup(playtree);