From 25a4d10c8e75d9ff94e843d4951ab1eb2917435e Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 22 May 2017 18:30:39 +0200 Subject: player: make sure version information is always included in --log-file If --log-file was used in config files, this could be missing due to the exact timing when the messages are print, and when the options are applied. Fix this by always dumping the version again when a log file is opened. --- player/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'player/main.c') diff --git a/player/main.c b/player/main.c index 2045e3b40a..fa00f0a463 100644 --- a/player/main.c +++ b/player/main.c @@ -114,6 +114,8 @@ static bool cas_terminal_owner(struct MPContext *old, struct MPContext *new) void mp_update_logging(struct MPContext *mpctx, bool preinit) { + bool had_log_file = mp_msg_has_log_file(mpctx->global); + mp_msg_update_msglevels(mpctx->global); bool enable = mpctx->opts->use_terminal; @@ -128,6 +130,9 @@ void mp_update_logging(struct MPContext *mpctx, bool preinit) } } + if (mp_msg_has_log_file(mpctx->global) && !had_log_file) + mp_print_version(mpctx->log, false); // for log-file=... in config files + if (enabled && !preinit && mpctx->opts->consolecontrols) terminal_setup_getch(mpctx->input); } -- cgit v1.2.3