summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-10-17 02:53:11 +0200
committersfan5 <sfan5@live.de>2023-10-18 11:34:52 +0200
commit02d009bc5c2dca3326c1a2551093c4bc3a67a6f7 (patch)
tree258bd94dd2cdad1dff28bf601b0b518d5e2776fc /player
parent11bbb49bdfcb43101bf00e6ffdcc097b751f78bb (diff)
downloadmpv-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.c4
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);