From d061f28397937f0eae8fc7ba3b13913bbf29a9b7 Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Fri, 1 May 2020 20:24:44 +0200 Subject: player: round position percentage to the nearest integer This brings the displayed percentage closer to the exact number and allows mpv to more frequently display 100% when it finishes playing a typical video or audio file. --- player/playloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index c2e9f5efef..7b8b65e0f0 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -573,7 +573,7 @@ double get_current_pos_ratio(struct MPContext *mpctx, bool use_range) int get_percent_pos(struct MPContext *mpctx) { double pos = get_current_pos_ratio(mpctx, false); - return pos < 0 ? -1 : pos * 100; + return pos < 0 ? -1 : (int)round(pos * 100); } // -2 is no chapters, -1 is before first chapter -- cgit v1.2.3