summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-18 01:25:59 +0200
committerwm4 <wm4@nowhere>2014-08-18 01:25:59 +0200
commit9f31b73cda23eba00924b179b7bee8d34692f382 (patch)
tree31efb13893446ff16c124e65866727695ffce833 /player
parenteb2924054ff0c30fa7f414dfdc883c0afb25862e (diff)
downloadmpv-9f31b73cda23eba00924b179b7bee8d34692f382.tar.bz2
mpv-9f31b73cda23eba00924b179b7bee8d34692f382.tar.xz
player: never print status messages before playback begins
After a new file is loaded, playback never starts instantly. Rather, it takes some playloop iterations until initial audio and video have been decoded, and the outputs have been (lazily) initialized. This means you will get status line updates between the messages that inform of the initialized outputs. This is a bit annoying and clutters the terminal output needlessly. Fix this by never printing the status line before playback isn't fully initialized. Do this by reusing the --term-playing-msg code (which prints a message once playback is initialized). This also makes sure the status line _is_ shown during playback restart when doing seeks. It's possible that the change will make the output more confusing if for some reason is stuck forever initializing playback, but that seems like an obscure corner case that never happens, so forget about it.
Diffstat (limited to 'player')
-rw-r--r--player/osd.c4
-rw-r--r--player/playloop.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/player/osd.c b/player/osd.c
index 094e99e5b6..e3fe9e1c9b 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -155,7 +155,9 @@ static void print_status(struct MPContext *mpctx)
if (!opts->use_terminal)
return;
- if (opts->quiet || !(mpctx->initialized_flags & INITIALIZED_PLAYBACK)) {
+ if (opts->quiet || !(mpctx->initialized_flags & INITIALIZED_PLAYBACK) ||
+ !mpctx->playing_msg_shown)
+ {
term_osd_set_status(mpctx, "");
return;
}
diff --git a/player/playloop.c b/player/playloop.c
index 5b4c7c7fab..a8c47d8e66 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -852,12 +852,12 @@ void run_playloop(struct MPContext *mpctx)
mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL);
mpctx->restart_complete = true;
if (opts->playing_msg && !mpctx->playing_msg_shown) {
- mpctx->playing_msg_shown = true;
char *msg =
mp_property_expand_escaped_string(mpctx, opts->playing_msg);
MP_INFO(mpctx, "%s\n", msg);
talloc_free(msg);
}
+ mpctx->playing_msg_shown = true;
}
}