summaryrefslogtreecommitdiffstats
path: root/core/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-20 17:20:45 +0100
committerwm4 <wm4@nowhere>2012-11-20 18:00:16 +0100
commit2cdbaaf31c85b27923c1795b5c4e3e576cdb4567 (patch)
tree8df97f6cfd4b3b6197cefc6338118f4bfe35dfb3 /core/command.c
parent0e63702ef830f123d735cbbb436e3e805ad0b2d0 (diff)
downloadmpv-2cdbaaf31c85b27923c1795b5c4e3e576cdb4567.tar.bz2
mpv-2cdbaaf31c85b27923c1795b5c4e3e576cdb4567.tar.xz
osd: fix OSD status symbol display in some cases
The playback status symbol in the OSD status display on video (such as displayed when seeking or with the show_progress input command) sometimes kept displaying the last seek, without resetting the symbol. (For example: disable the OSD, seek, enable the OSD, run show_progress; but also other cases.) The main reason for that was the code clearing the OSD bar is also responsible for clearing the osd_function (which stores the playback symbol). If no OSD bar was set, the osd_function was never reset. Fix by always setting the timer for clearing the OSD bar and the osd_function whenever the osd_function is set. Clearing the OSD bar when it wasn't set is OK. If the OSD bar is set some time after osd_function is set, the timer is overwritten - that's a good thing, as it makes both disappear from the screen at exactly the same time. Always reset osd_function to 0 and determine the playback status explicitly from mpctx->paused when displaying the status on screen.
Diffstat (limited to 'core/command.c')
-rw-r--r--core/command.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/core/command.c b/core/command.c
index 739f0feb13..7f2940fbaa 100644
--- a/core/command.c
+++ b/core/command.c
@@ -1756,23 +1756,21 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
float v = cmd->args[0].v.f;
int abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0;
int exact = (cmd->nargs > 2) ? cmd->args[2].v.i : 0;
- int function;
if (abs == 2) { // Absolute seek to a timestamp in seconds
queue_seek(mpctx, MPSEEK_ABSOLUTE, v, exact);
- function = v > get_current_time(mpctx) ? OSD_FFW : OSD_REW;
+ set_osd_function(mpctx,
+ v > get_current_time(mpctx) ? OSD_FFW : OSD_REW);
} else if (abs) { /* Absolute seek by percentage */
queue_seek(mpctx, MPSEEK_FACTOR, v / 100.0, exact);
- function = OSD_FFW; // Direction isn't set correctly
+ set_osd_function(mpctx, OSD_FFW); // Direction isn't set correctly
} else {
queue_seek(mpctx, MPSEEK_RELATIVE, v, exact);
- function = (v > 0) ? OSD_FFW : OSD_REW;
+ set_osd_function(mpctx, (v > 0) ? OSD_FFW : OSD_REW);
}
if (bar_osd)
mpctx->add_osd_seek_info |= OSD_SEEK_INFO_BAR;
if (msg_osd && !auto_osd)
mpctx->add_osd_seek_info |= OSD_SEEK_INFO_TEXT;
- if (mpctx->add_osd_seek_info)
- mpctx->osd_function = function;
break;
}