summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-11-24 13:58:57 +0100
committerwm4 <wm4@nowhere>2017-11-24 13:58:57 +0100
commitefbb91999796a33c91761d2c206d0f42beb4954c (patch)
tree58635fb0959f02cd4d34b9f72c44704e801114e5 /player/loadfile.c
parent274cc06aaf7ce764164898b31951c0d03b8c3638 (diff)
downloadmpv-efbb91999796a33c91761d2c206d0f42beb4954c.tar.bz2
mpv-efbb91999796a33c91761d2c206d0f42beb4954c.tar.xz
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).
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c3
1 files changed, 3 insertions, 0 deletions
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;