aboutsummaryrefslogtreecommitdiffhomepage
path: root/player/main.c
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2017-05-22 18:30:39 +0200
committerGravatar wm4 <wm4@nowhere>2017-05-22 18:31:39 +0200
commit25a4d10c8e75d9ff94e843d4951ab1eb2917435e (patch)
treebe6df52ee4965ce2e9583e095c5f22cc70814541 /player/main.c
parent5974f575a6ac9c107afa292bd877a73a5221952b (diff)
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.
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c5
1 files changed, 5 insertions, 0 deletions
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);
}