summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-22 16:11:44 +0200
committerwm4 <wm4@nowhere>2014-10-22 16:11:44 +0200
commitbe950351d93202097e869d64a0b1d0e4fd91bd34 (patch)
tree219d61085ae57e5d51f128b0f0c5a9632db29ef7 /player
parent0e4658c99c6e9e0767c5a4234de78605e698bf26 (diff)
downloadmpv-be950351d93202097e869d64a0b1d0e4fd91bd34.tar.bz2
mpv-be950351d93202097e869d64a0b1d0e4fd91bd34.tar.xz
player: show busy symbol on OSD if seeking takes too long
Same as it's done on the terminal.
Diffstat (limited to 'player')
-rw-r--r--player/osd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/player/osd.c b/player/osd.c
index eccaf742e4..a7bf981695 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -147,6 +147,11 @@ static void add_term_osd_bar(struct MPContext *mpctx, char **line, int width)
saddf(line, "%.*s", BSTR_P(parts[4]));
}
+static bool is_busy(struct MPContext *mpctx)
+{
+ return !mpctx->restart_complete && mp_time_sec() - mpctx->start_timestamp > 0.3;
+}
+
static void print_status(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
@@ -172,7 +177,7 @@ static void print_status(struct MPContext *mpctx)
char *line = NULL;
// Playback status
- if (!mpctx->restart_complete && mp_time_sec() - mpctx->start_timestamp > 0.3) {
+ if (is_busy(mpctx)) {
saddf(&line, "(...) ");
} else if (mpctx->paused_for_cache && !opts->pause) {
saddf(&line, "(Buffering) ");
@@ -368,7 +373,7 @@ void get_current_osd_sym(struct MPContext *mpctx, char *buf, size_t buf_size)
{
int sym = mpctx->osd_function;
if (!sym) {
- if (mpctx->paused_for_cache && !mpctx->opts->pause) {
+ if (is_busy(mpctx) || (mpctx->paused_for_cache && !mpctx->opts->pause)) {
sym = OSD_CLOCK;
} else if (mpctx->paused || mpctx->step_frames) {
sym = OSD_PAUSE;