summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorrrooij <rderooij685@gmail.com>2015-05-19 22:20:33 +0200
committerwm4 <wm4@nowhere>2015-05-19 23:23:04 +0200
commit36529bc6f7a777899d06c6bb80b40b4e7a886464 (patch)
tree895f408d6cc4a20ba7e4e9e31b54203721acde57 /player
parente57a44c34122f17b37cf7af8c7b433b1a87c090f (diff)
downloadmpv-36529bc6f7a777899d06c6bb80b40b4e7a886464.tar.bz2
mpv-36529bc6f7a777899d06c6bb80b40b4e7a886464.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/command.c6
1 files changed, 4 insertions, 2 deletions
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);