mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 12:17:12 +00:00
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.
This commit is contained in:
parent
92db8731dd
commit
d061f28397
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user