From 36529bc6f7a777899d06c6bb80b40b4e7a886464 Mon Sep 17 00:00:00 2001 From: rrooij Date: Tue, 19 May 2015 22:20:33 +0200 Subject: command: change OSD symbol for absolute perc. seek The OSD symbol for seeking to an absolute percentage was always OSD_FFW, even when it should be OSD_REW. It uses the correct OSD symbols now, by checking the current position ratio. Note: The symbol is still incorrectly given when the absolute percentage is very close to the current position ratio. Fortunately, that's a rare use case. --- player/command.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index 0fb36d7142..7d9049d89d 100644 --- a/player/command.c +++ b/player/command.c @@ -4124,8 +4124,10 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re precision, false); set_osd_function(mpctx, v > 0 ? OSD_FFW : OSD_REW); } else if (abs) { // Absolute seek by percentage - queue_seek(mpctx, MPSEEK_FACTOR, v / 100.0, precision, false); - set_osd_function(mpctx, OSD_FFW); // Direction isn't set correctly + double ratio = v / 100.0; + double cur_pos = get_current_pos_ratio(mpctx, false); + queue_seek(mpctx, MPSEEK_FACTOR, ratio, precision, false); + set_osd_function(mpctx, cur_pos < ratio ? OSD_FFW : OSD_REW); } else { queue_seek(mpctx, MPSEEK_RELATIVE, v, precision, false); set_osd_function(mpctx, (v > 0) ? OSD_FFW : OSD_REW); -- cgit v1.2.3