Skip to content

Commit

Permalink
player/command: remove /100 from sub-pos print
Browse files Browse the repository at this point in the history
It already prints %, so there's no need for '/100'. Also, use the print
helper while at it.

6ea08be added a percent sign but didn't
remove '/100', so we ended up with both, which is redundant.
  • Loading branch information
kasper93 committed Nov 14, 2024
1 parent 3772b8e commit 70aaba7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions player/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 70aaba7

Please sign in to comment.