changeset 33877:c52940fe54dd

Move cfg_inc_verbose and cfg_include into mpcommon.c.
author diego
date Thu, 11 Aug 2011 17:45:25 +0000
parents 4789b8eed97e
children 1395723bf048
files mencoder.c mpcommon.c mpcommon.h mplayer.c
diffstat 4 files changed, 17 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Thu Aug 11 13:54:24 2011 +0000
+++ b/mencoder.c	Thu Aug 11 17:45:25 2011 +0000
@@ -220,16 +220,6 @@
     vo_osd_changed(OSDTYPE_SUBTITLE);
 }
 
-//-------------------------- config stuff:
-
-m_config_t* mconfig;
-
-static int cfg_inc_verbose(m_option_t *conf){ ++verbose; return 0;}
-
-static int cfg_include(m_option_t *conf, const char *filename){
-	return m_config_parse_config_file(mconfig, filename);
-}
-
 static double seek_to_sec;
 static off_t seek_to_byte=0;
 
--- a/mpcommon.c	Thu Aug 11 13:54:24 2011 +0000
+++ b/mpcommon.c	Thu Aug 11 17:45:25 2011 +0000
@@ -40,6 +40,7 @@
 #include "cpudetect.h"
 #include "help_mp.h"
 #include "mp_msg.h"
+#include "parser-cfg.h"
 #include "sub/spudec.h"
 #include "version.h"
 #include "sub/vobsub.h"
@@ -407,6 +408,19 @@
 #endif /* CONFIG_GUI */
 }
 
+m_config_t *mconfig;
+
+int cfg_inc_verbose(m_option_t *conf)
+{
+    ++verbose;
+    return 0;
+}
+
+int cfg_include(m_option_t *conf, const char *filename)
+{
+    return m_config_parse_config_file(mconfig, filename);
+}
+
 const m_option_t noconfig_opts[] = {
     {"all", noconfig_all, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
     {"system", &disable_system_conf, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 1, NULL},
--- a/mpcommon.h	Thu Aug 11 13:54:24 2011 +0000
+++ b/mpcommon.h	Thu Aug 11 17:45:25 2011 +0000
@@ -77,6 +77,9 @@
 int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang);
 void set_osd_subtitle(subtitle *subs);
 
+int cfg_inc_verbose(m_option_t *conf);
+int cfg_include(m_option_t *conf, const char *filename);
+
 void common_preinit(void);
 int common_init(void);
 
--- a/mplayer.c	Thu Aug 11 13:54:24 2011 +0000
+++ b/mplayer.c	Thu Aug 11 17:45:25 2011 +0000
@@ -145,24 +145,6 @@
 float start_volume = -1;
 double start_pts   = MP_NOPTS_VALUE;
 char *heartbeat_cmd;
-
-m_config_t *mconfig;
-
-//**************************************************************************//
-//             Config file
-//**************************************************************************//
-
-static int cfg_inc_verbose(m_option_t *conf)
-{
-    ++verbose;
-    return 0;
-}
-
-static int cfg_include(m_option_t *conf, const char *filename)
-{
-    return m_config_parse_config_file(mconfig, filename);
-}
-
 static int max_framesize;
 
 int noconsolecontrols;