From 70aaba71d6e3071a732069a1d222d1eb4293faf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 3 Nov 2024 20:59:17 +0100 Subject: [PATCH] player/command: remove /100 from sub-pos print It already prints %, so there's no need for '/100'. Also, use the print helper while at it. 6ea08be59ac503f7309a19a50d5e664426e8c9f3 added a percent sign but didn't remove '/100', so we ended up with both, which is redundant. --- player/command.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/player/command.c b/player/command.c index 118f2b2f31157..b62d4cccb62c4 100644 --- a/player/command.c +++ b/player/command.c @@ -3171,8 +3171,9 @@ static int mp_property_sub_pos(void *ctx, struct m_property *prop, MPContext *mpctx = ctx; struct MPOpts *opts = mpctx->opts; int track_ind = *(int *)prop->priv; - if (action == M_PROPERTY_PRINT) { - *(char **)arg = talloc_asprintf(NULL, "%4.2f%%/100", opts->subs_shared->sub_pos[track_ind]); + if (action == M_PROPERTY_PRINT || action == M_PROPERTY_FIXED_LEN_PRINT) { + *(char **)arg = mp_format_double(NULL, opts->subs_shared->sub_pos[track_ind], 2, + false, true, action != M_PROPERTY_FIXED_LEN_PRINT); return M_PROPERTY_OK; } return mp_property_generic_option(mpctx, prop, action, arg);