From 1d9c62b644a3f8da39802ed99dc27e85bdd47792 Mon Sep 17 00:00:00 2001 From: Johannes Nixdorf Date: Wed, 15 Jan 2014 21:43:57 +0100 Subject: 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. --- player/osd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'player/osd.c') 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]; -- cgit v1.2.3