[MPlayer-cvslog] CVS: main m_config.c, 1.12, 1.13 parser-mpcmd.c, 1.23, 1.24

Alban Bedel CVS syncmail at mplayerhq.hu
Tue Jan 24 12:34:26 CET 2006


CVS change done by Alban Bedel CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv23533

Modified Files:
	m_config.c parser-mpcmd.c 
Log Message:
Make -list-options work in both MPlayer and MEncoder.


Index: m_config.c
===================================================================
RCS file: /cvsroot/mplayer/main/m_config.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- m_config.c	24 Jan 2006 11:16:13 -0000	1.12
+++ m_config.c	24 Jan 2006 11:34:24 -0000	1.13
@@ -27,6 +27,9 @@
 static void
 m_config_add_option(m_config_t *config, m_option_t *arg, char* prefix);
 
+static int
+list_options(m_option_t *opt, char* name, char *param);
+
 m_config_t*
 m_config_new(void) {
   m_config_t* config;
@@ -35,6 +38,7 @@
   static m_option_t ref_opts[] = {
     { "profile", NULL, &profile_opt_type, CONF_NOSAVE, 0, 0, NULL },
     { "show-profile", show_profile, CONF_TYPE_PRINT_FUNC, CONF_NOCFG, 0, 0, NULL },
+    { "list-options", list_options, CONF_TYPE_PRINT_FUNC, CONF_NOCFG, 0, 0, NULL },
     { NULL, NULL, NULL, 0, 0, 0, NULL }
   };
   int i;
@@ -576,3 +580,10 @@
   if(!config->profile_depth) mp_msg(MSGT_CFGPARSER, MSGL_INFO, "\n");
   return M_OPT_EXIT-1;
 }
+
+static int
+list_options(m_option_t *opt, char* name, char *param) {
+  m_config_t* config = opt->priv;
+  m_config_print_option_list(config);
+  return M_OPT_EXIT;
+}

Index: parser-mpcmd.c
===================================================================
RCS file: /cvsroot/mplayer/main/parser-mpcmd.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- parser-mpcmd.c	2 Sep 2005 08:29:30 -0000	1.23
+++ parser-mpcmd.c	24 Jan 2006 11:34:24 -0000	1.24
@@ -136,11 +136,8 @@
 
 	mp_msg(MSGT_CFGPARSER, MSGL_DBG3, "this_opt = option: %s\n", opt);
 	// We handle here some specific option
-	if(strcasecmp(opt,"list-options") == 0) {
-	  m_config_print_option_list(config);
-	  exit(1);
-	  // Loop option when it apply to a group
-	} else if(strcasecmp(opt,"loop") == 0 &&
+	// Loop option when it apply to a group
+	if(strcasecmp(opt,"loop") == 0 &&
 		  (! last_entry || last_entry->child) ) {
 	  int l;
 	  char* end;




More information about the MPlayer-cvslog mailing list