From 8e75cc3339801cec242f0bdce0d4e0dd261f1876 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Dec 2013 22:00:26 +0100 Subject: player: use separate msg prefix for statusline So the user can specifically mute or unmute the status line with --msglevel. Accidentally removed with commit 5e0c4ec3. --- player/core.h | 1 + player/main.c | 1 + player/osd.c | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'player') diff --git a/player/core.h b/player/core.h index ad3d121aa7..711c99840b 100644 --- a/player/core.h +++ b/player/core.h @@ -147,6 +147,7 @@ typedef struct MPContext { struct mpv_global *global; struct MPOpts *opts; struct mp_log *log; + struct mp_log *statusline; struct m_config *mconfig; struct input_ctx *input; struct osd_state *osd; diff --git a/player/main.c b/player/main.c index c778507d1c..1844746650 100644 --- a/player/main.c +++ b/player/main.c @@ -298,6 +298,7 @@ static int mpv_main(int argc, char *argv[]) // Nothing must call mp_msg*() and related before this mp_msg_init(mpctx->global); mpctx->log = mp_log_new(mpctx, mpctx->global->log, "!cplayer"); + mpctx->statusline = mp_log_new(mpctx, mpctx->log, "!statusline"); // Create the config context and register the options mpctx->mconfig = m_config_new(mpctx, mpctx->log, sizeof(struct MPOpts), diff --git a/player/osd.c b/player/osd.c index f475757bdc..607af6714e 100644 --- a/player/osd.c +++ b/player/osd.c @@ -72,13 +72,13 @@ void write_status_line(struct MPContext *mpctx, const char *line) { struct MPOpts *opts = mpctx->opts; if (opts->slave_mode) { - MP_MSG(mpctx, MSGL_STATUS, "%s\n", line); + mp_msg(mpctx->statusline, MSGL_STATUS, "%s\n", line); } else if (erase_to_end_of_line) { - MP_MSG(mpctx, MSGL_STATUS, "%s%s\r", line, erase_to_end_of_line); + mp_msg(mpctx->statusline, MSGL_STATUS, "%s%s\r", line, erase_to_end_of_line); } else { int pos = strlen(line); int width = get_term_width() - pos; - MP_MSG(mpctx, MSGL_STATUS, "%s%*s\r", line, width, ""); + mp_msg(mpctx->statusline, MSGL_STATUS, "%s%*s\r", line, width, ""); } } -- cgit v1.2.3