diff options
author | wm4 <wm4@nowhere> | 2015-04-10 20:40:50 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-10 20:40:50 +0200 |
commit | cf55fa64710bdd5999b437f0cccdb036324ae11e (patch) | |
tree | e94bffc57312838511b6fa44cd446a0fd280fc2e /player/main.c | |
parent | 1e692cb043ac109d734de366859298d28d96b2ed (diff) | |
download | mpv-cf55fa64710bdd5999b437f0cccdb036324ae11e.tar.bz2 mpv-cf55fa64710bdd5999b437f0cccdb036324ae11e.tar.xz |
player: use config parser for setting up pseudo-gui profile
Diffstat (limited to 'player/main.c')
-rw-r--r-- | player/main.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/player/main.c b/player/main.c index 2f64c3b67e..c517e871f6 100644 --- a/player/main.c +++ b/player/main.c @@ -99,6 +99,12 @@ const char mp_help_text[] = " --list-options list all mpv options\n" "\n"; +static const char def_config[] = + "[pseudo-gui]\n" + "terminal=no\n" + "force-window=yes\n" + "idle=once\n"; + static pthread_mutex_t terminal_owner_lock = PTHREAD_MUTEX_INITIALIZER; static struct MPContext *terminal_owner; @@ -313,14 +319,6 @@ static int cfg_include(void *ctx, char *filename, int flags) return r; } -static void add_default_profiles(struct m_config *cfg) -{ - struct m_profile *ui = m_config_add_profile(cfg, "pseudo-gui"); - m_config_set_profile_option(cfg, ui, bstr0("terminal"), bstr0("no")); - m_config_set_profile_option(cfg, ui, bstr0("force-window"), bstr0("yes")); - m_config_set_profile_option(cfg, ui, bstr0("idle"), bstr0("once")); -} - struct MPContext *mp_create(void) { mp_time_init(); @@ -354,7 +352,7 @@ struct MPContext *mp_create(void) mpctx->mconfig->includefunc_ctx = mpctx; mpctx->mconfig->use_profiles = true; mpctx->mconfig->is_toplevel = true; - add_default_profiles(mpctx->mconfig); + m_config_parse(mpctx->mconfig, "", bstr0(def_config), NULL, 0); mpctx->global->opts = mpctx->opts; |