summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorJohannes Nixdorf <mixi@exherbo.org>2014-01-15 21:43:57 +0100
committerJohannes Nixdorf <mixi@exherbo.org>2014-01-15 23:12:34 +0100
commit1d9c62b644a3f8da39802ed99dc27e85bdd47792 (patch)
tree1f9c2c45851e4aa831b6011dac344bb92405287b /player
parent195e087086dd2cf7be0fea56ac7b703d32bd59fe (diff)
downloadmpv-1d9c62b644a3f8da39802ed99dc27e85bdd47792.tar.bz2
mpv-1d9c62b644a3f8da39802ed99dc27e85bdd47792.tar.xz
player: use more than 1/100 resolution for --term-osd-bar
If the terminal width is large enough the position marker jumps over several characters because currently pos only increases in 1/100th steps.
Diffstat (limited to 'player')
-rw-r--r--player/osd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/osd.c b/player/osd.c
index 29ac7af8fe..f3096ea5cf 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -110,7 +110,8 @@ static void add_term_osd_bar(struct MPContext *mpctx, char **line, int width)
if (width < 5)
return;
- int pos = get_percent_pos(mpctx) / 100.0 * (width - 2);
+ int pos = get_current_pos_ratio(mpctx, false) * (width - 2);
+ pos = MPCLAMP(pos, 0, width - 2);
bstr chars = bstr0(opts->term_osd_bar_chars);
bstr parts[5];