diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-10-17 02:53:11 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-10-18 11:34:52 +0200 |
commit | 02d009bc5c2dca3326c1a2551093c4bc3a67a6f7 (patch) | |
tree | 258bd94dd2cdad1dff28bf601b0b518d5e2776fc /player | |
parent | 11bbb49bdfcb43101bf00e6ffdcc097b751f78bb (diff) | |
download | mpv-02d009bc5c2dca3326c1a2551093c4bc3a67a6f7.tar.bz2 mpv-02d009bc5c2dca3326c1a2551093c4bc3a67a6f7.tar.xz |
player/command: truncate anything < 1e-4 in pretty printer
To avoid switching to scientific notation. Apparently it is "jarring"
for some users.
This preserves status quo from before 9dddfc4f where pretty printer were
truncated to 3 decimal places.
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c index b2ebb86b18..bfacc04282 100644 --- a/player/command.c +++ b/player/command.c @@ -652,8 +652,8 @@ static int mp_property_avsync(void *ctx, struct m_property *prop, if (!mpctx->ao_chain || !mpctx->vo_chain) return M_PROPERTY_UNAVAILABLE; if (action == M_PROPERTY_PRINT) { - // Don't print small values resulting from calculation inaccuracies - if (fabs(mpctx->last_av_difference) < 1e-5) { + // Truncate anything < 1e-4 to avoid switching to scientific notation + if (fabs(mpctx->last_av_difference) < 1e-4) { *(char **)arg = talloc_strdup(NULL, "0"); } else { *(char **)arg = talloc_asprintf(NULL, "%+.2g", mpctx->last_av_difference); |