diff options
Diffstat (limited to 'player/osd.c')
-rw-r--r-- | player/osd.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/player/osd.c b/player/osd.c index a95a6c56b1..70dbd1640a 100644 --- a/player/osd.c +++ b/player/osd.c @@ -57,14 +57,6 @@ static void sadd_hhmmssff(char **buf, double time, bool fractions) talloc_free(s); } -// If time unknown (MP_NOPTS_VALUE), use 0 instead. -static void sadd_hhmmssff_u(char **buf, double time, bool fractions) -{ - if (time == MP_NOPTS_VALUE) - time = 0; - sadd_hhmmssff(buf, time, fractions); -} - static void sadd_percentage(char **buf, int percent) { if (percent >= 0) *buf = talloc_asprintf_append(*buf, " (%d%%)", percent); @@ -207,13 +199,9 @@ static void term_osd_print_status_lazy(struct MPContext *mpctx) saddf(&line, ": "); // Playback position - sadd_hhmmssff_u(&line, get_playback_time(mpctx), mpctx->opts->osd_fractions); - - double len = get_time_length(mpctx); - if (len >= 0) { - saddf(&line, " / "); - sadd_hhmmssff(&line, len, mpctx->opts->osd_fractions); - } + sadd_hhmmssff(&line, get_playback_time(mpctx), mpctx->opts->osd_fractions); + saddf(&line, " / "); + sadd_hhmmssff(&line, get_time_length(mpctx), mpctx->opts->osd_fractions); sadd_percentage(&line, get_percent_pos(mpctx)); @@ -442,15 +430,12 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, int level) *buffer = talloc_strdup_append(*buffer, text); talloc_free(text); } else { - sadd_hhmmssff_u(buffer, get_playback_time(mpctx), fractions); + sadd_hhmmssff(buffer, get_playback_time(mpctx), fractions); #if HAVE_GPL // Potentially GPL due to 8d190244d21a4d40bb9e8f7d51aa09ca1888de09. if (level == 3) { - double len = get_time_length(mpctx); - if (len >= 0) { - saddf(buffer, " / "); - sadd_hhmmssff(buffer, len, fractions); - } + saddf(buffer, " / "); + sadd_hhmmssff(buffer, get_time_length(mpctx), fractions); sadd_percentage(buffer, get_percent_pos(mpctx)); } #endif |