diff options
author | wm4 <wm4@nowhere> | 2013-12-21 22:00:26 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-21 22:13:05 +0100 |
commit | 8e75cc3339801cec242f0bdce0d4e0dd261f1876 (patch) | |
tree | 71b9acf02e59d1f6cd5581d2761abaa23184c010 /player | |
parent | 6aaea76b4d62990419a53c715640dab1836bba7f (diff) | |
download | mpv-8e75cc3339801cec242f0bdce0d4e0dd261f1876.tar.bz2 mpv-8e75cc3339801cec242f0bdce0d4e0dd261f1876.tar.xz |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/core.h | 1 | ||||
-rw-r--r-- | player/main.c | 1 | ||||
-rw-r--r-- | player/osd.c | 6 |
3 files changed, 5 insertions, 3 deletions
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, ""); } } |