summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-29 16:26:54 +0200
committerwm4 <wm4@nowhere>2016-09-29 16:26:54 +0200
commitb81ae52f508fa1e4447e97223f79f4c59ff99197 (patch)
treec3e51fba477d5ef6fa859ce86aca3d07314a9c63 /player/main.c
parentc245d04c3767583247b0f8acc4cbaa8f61bafa0f (diff)
downloadmpv-b81ae52f508fa1e4447e97223f79f4c59ff99197.tar.bz2
mpv-b81ae52f508fa1e4447e97223f79f4c59ff99197.tar.xz
player: enable reading from stdin after loading input.conf
Someone requested this.
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/player/main.c b/player/main.c
index 7dcc266094..1f32d375bd 100644
--- a/player/main.c
+++ b/player/main.c
@@ -112,7 +112,7 @@ static bool cas_terminal_owner(struct MPContext *old, struct MPContext *new)
return r;
}
-void mp_update_logging(struct MPContext *mpctx)
+void mp_update_logging(struct MPContext *mpctx, bool preinit)
{
mp_msg_update_msglevels(mpctx->global);
@@ -121,13 +121,14 @@ void mp_update_logging(struct MPContext *mpctx)
if (enable != enabled) {
if (enable && cas_terminal_owner(NULL, mpctx)) {
terminal_init();
+ enabled = true;
} else if (!enable) {
terminal_uninit();
cas_terminal_owner(mpctx, NULL);
}
}
- if (cas_terminal_owner(mpctx, mpctx) && mpctx->opts->consolecontrols)
+ if (enabled && !preinit && mpctx->opts->consolecontrols)
terminal_setup_getch(mpctx->input);
}
@@ -384,7 +385,7 @@ int mp_initialize(struct MPContext *mpctx, char **options)
if (options)
m_config_preparse_command_line(mpctx->mconfig, mpctx->global, options);
- mp_update_logging(mpctx);
+ mp_update_logging(mpctx, true);
if (options) {
MP_VERBOSE(mpctx, "Command line options:");
@@ -412,6 +413,8 @@ int mp_initialize(struct MPContext *mpctx, char **options)
mp_get_resume_defaults(mpctx);
+ mp_input_load_config(mpctx->input);
+
// From this point on, all mpctx members are initialized.
mpctx->initialized = true;
mpctx->mconfig->option_set_callback = mp_on_set_option;
@@ -443,8 +446,6 @@ int mp_initialize(struct MPContext *mpctx, char **options)
MP_STATS(mpctx, "start init");
- mp_input_load_config(mpctx->input);
-
#if HAVE_ENCODING
if (opts->encode_opts->file && opts->encode_opts->file[0]) {
mpctx->encode_lavc_ctx = encode_lavc_init(opts->encode_opts,