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/loadfile.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 63089abe49..3551117522 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1163,6 +1163,9 @@ static void play_current_file(struct MPContext *mpctx) reset_playback_state(mpctx); + // let get_current_time() show 0 as start time (before playback_pts is set) + mpctx->last_seek_pts = 0.0; + mpctx->playing = mpctx->playlist->current; if (!mpctx->playing || !mpctx->playing->filename) goto terminate_playback; -- cgit v1.2.3