1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-24 12:22:25 +00:00

player: enable reading from stdin after loading input.conf

Someone requested this.
This commit is contained in:
wm4 2016-09-29 16:26:54 +02:00
parent c245d04c37
commit b81ae52f50
3 changed files with 8 additions and 7 deletions

View File

@ -5668,7 +5668,7 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags)
struct command_ctx *cmd = mpctx->command_ctx;
if (flags & UPDATE_TERM)
mp_update_logging(mpctx);
mp_update_logging(mpctx, false);
if (mpctx->video_out) {
if (flags & UPDATE_VIDEOPOS)

View File

@ -486,7 +486,7 @@ int mp_initialize(struct MPContext *mpctx, char **argv);
struct MPContext *mp_create(void);
void mp_destroy(struct MPContext *mpctx);
void mp_print_version(struct mp_log *log, int always);
void mp_update_logging(struct MPContext *mpctx);
void mp_update_logging(struct MPContext *mpctx, bool preinit);
// misc.c
double rel_time_to_abs(struct MPContext *mpctx, struct m_rel_time t);

View File

@ -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,