From 29af78721760e426b920904d44566de482e30709 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 24 Dec 2017 01:56:09 +0100 Subject: player: update duration based on highest timestamp demuxed This will help with things like livestreams. As a minor detail, subtitles are excluded, because they sometimes have "unused" events after video and audio ends. To avoid this annoying corner case, just ignore them. --- player/loadfile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 8139c06f3f..d2e26c1ba4 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -212,6 +212,8 @@ void update_demuxer_properties(struct MPContext *mpctx) mpctx->filtered_tags = info; mp_notify(mpctx, MPV_EVENT_METADATA_UPDATE, NULL); } + if (events & DEMUX_EVENT_DURATION) + mp_notify(mpctx, MP_EVENT_DURATION_UPDATE, NULL); demuxer->events = 0; } -- cgit v1.2.3