changeset 8736:d3b750570887

pphelp
author michael
date Fri, 03 Jan 2003 12:40:10 +0000
parents 265cbc7079c0
children 8fd62b14cbc0
files cfg-common.h cfg-mencoder.h cfg-mplayer.h libmpcodecs/vf_pp.c m_option.c m_option.h
diffstat 6 files changed, 24 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-common.h	Fri Jan 03 12:36:14 2003 +0000
+++ b/cfg-common.h	Fri Jan 03 12:40:10 2003 +0000
@@ -141,6 +141,7 @@
         {"oldpp", "MPlayer was compiled without opendivx library\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
 #endif
 	{"npp", "-npp has been removed, use -vop pp and read the fine manual\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+        {"pphelp", &pp_help, CONF_TYPE_PRINT_INDIRECT, CONF_NOCFG, 0, 0, NULL},
 
 	{"vop", &vo_plugin_args, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
 
--- a/cfg-mencoder.h	Fri Jan 03 12:36:14 2003 +0000
+++ b/cfg-mencoder.h	Fri Jan 03 12:40:10 2003 +0000
@@ -14,6 +14,7 @@
 extern int sws_flags;
 extern int readPPOpt(void *, char *arg);
 extern void revertPPOpt(void *conf, char* opt);
+extern char *pp_help;
 
 #ifdef HAVE_DIVX4ENCORE
 extern struct config divx4opts_conf[];
--- a/cfg-mplayer.h	Fri Jan 03 12:36:14 2003 +0000
+++ b/cfg-mplayer.h	Fri Jan 03 12:40:10 2003 +0000
@@ -160,7 +160,7 @@
 extern int sws_flags;
 extern int readPPOpt(void *conf, char *arg);
 extern void revertPPOpt(void *conf, char* opt);
-
+extern char* pp_help;
 
 /*
  * CONF_TYPE_FUNC_FULL :
--- a/libmpcodecs/vf_pp.c	Fri Jan 03 12:36:14 2003 +0000
+++ b/libmpcodecs/vf_pp.c	Fri Jan 03 12:40:10 2003 +0000
@@ -152,11 +152,6 @@
     if(!vf->priv->outfmt) return 0; // no csp match :(
     
     if(args){
-	if(!strcmp("help", args)){
-		printf("%s", pp_help);
-		exit(1);
-	}
-	
 	hex_mode= strtol(args, &endptr, 0);
 	if(*endptr){
             name= args;
--- a/m_option.c	Fri Jan 03 12:36:14 2003 +0000
+++ b/m_option.c	Fri Jan 03 12:40:10 2003 +0000
@@ -765,7 +765,11 @@
 /////////////////// Print
 
 static int parse_print(m_option_t* opt,char *name, char *param, void* dst, int src) {
-  mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", (char *) opt->p);
+  if(opt->type->flags&M_OPT_TYPE_INDIRECT)
+    mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", *(char **) opt->p);
+  else
+    mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", (char *) opt->p);
+
   if(opt->priv == NULL)
     exit(1); // Call something else instead ??
   return 1;
@@ -784,6 +788,20 @@
   NULL
 };
 
+m_option_type_t m_option_type_print_indirect = {
+  "Print",
+  "",
+  0,
+  M_OPT_TYPE_INDIRECT,
+  parse_print,
+  NULL,
+  NULL,
+  NULL,
+  NULL,
+  NULL
+};
+
+
 /////////////////////// Subconfig
 #undef VAL
 #define VAL(x) (*(char***)(x))
--- a/m_option.h	Fri Jan 03 12:36:14 2003 +0000
+++ b/m_option.h	Fri Jan 03 12:40:10 2003 +0000
@@ -17,6 +17,7 @@
 extern m_option_type_t m_option_type_position;
 
 extern m_option_type_t m_option_type_print;
+extern m_option_type_t m_option_type_print_indirect;
 extern m_option_type_t m_option_type_subconfig;
 extern m_option_type_t m_option_type_imgfmt;
 
@@ -59,6 +60,7 @@
 #define CONF_TYPE_FUNC		(&m_option_type_func)
 #define CONF_TYPE_FUNC_PARAM	(&m_option_type_func_param)
 #define CONF_TYPE_PRINT		(&m_option_type_print)
+#define CONF_TYPE_PRINT_INDIRECT (&m_option_type_print_indirect)
 #define CONF_TYPE_FUNC_FULL	(&m_option_type_func_full)
 #define CONF_TYPE_SUBCONFIG	(&m_option_type_subconfig)
 #define CONF_TYPE_STRING_LIST           (&m_option_type_string_list)