From efbb91999796a33c91761d2c206d0f42beb4954c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 24 Nov 2017 13:58:57 +0100 Subject: player: minor fix/simplification of OSD time/duration handling Always display the duration as "unknown" if the duration is known. Also fix that at least demux_lavf reported unknown duration as 0 (fix by setting the default to unknown in demux.c). Remove the dumb _u formatter function, and use a different approach to avoiding displaying "unknown" as playback time on playback start (set last_seek_pts for that). --- player/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index 807b2614a7..b5317e1470 100644 --- a/player/command.c +++ b/player/command.c @@ -837,7 +837,7 @@ static bool time_remaining(MPContext *mpctx, double *remaining) double len = get_time_length(mpctx); double playback = get_playback_time(mpctx); - if (playback == MP_NOPTS_VALUE) + if (playback == MP_NOPTS_VALUE || len <= 0) return false; *remaining = len - playback; -- cgit v1.2.3