summaryrefslogtreecommitdiffstats
path: root/mpcommon.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-04-14 11:21:29 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-04-14 11:21:29 +0000
commit6e62b3a85fc2c7a74dd3242bf123cc5f26adaeb0 (patch)
treef049be7e07ecb9657bce2fb8e6945475583099ec /mpcommon.c
parentc439e8b46859edc563e3a7177c7b957acaeb7315 (diff)
downloadmpv-6e62b3a85fc2c7a74dd3242bf123cc5f26adaeb0.tar.bz2
mpv-6e62b3a85fc2c7a74dd3242bf123cc5f26adaeb0.tar.xz
Add options to disable some or all config files.
Patch by Andrew Savchenko (Bircoph -at- list -dot- ru). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26448 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mpcommon.c')
-rw-r--r--mpcommon.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/mpcommon.c b/mpcommon.c
index 55e3cef19c..d603623964 100644
--- a/mpcommon.c
+++ b/mpcommon.c
@@ -11,6 +11,7 @@
#include "stream/tv.h"
#endif
#include "libavutil/intreadwrite.h"
+#include "m_option.h"
double sub_last_pts = -303;
@@ -205,3 +206,28 @@ int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang)
}
return demuxer->audio->id;
}
+
+/* Parse -noconfig common to both programs */
+int disable_system_conf=0;
+int disable_user_conf=0;
+extern int disable_gui_conf;
+
+/* Disable all configuration files */
+static void noconfig_all(void)
+{
+ disable_system_conf = 1;
+ disable_user_conf = 1;
+#ifdef HAVE_NEW_GUI
+ disable_gui_conf = 1;
+#endif /* HAVE_NEW_GUI */
+}
+
+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},
+ {"user", &disable_user_conf, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 1, NULL},
+#ifdef HAVE_NEW_GUI
+ {"gui", &disable_gui_conf, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 1, NULL},
+#endif /* HAVE_NEW_GUI */
+ {NULL, NULL, 0, 0, 0, 0, NULL}
+};