From 9fe4e10c7dfb7591adc39d0f0b77f4bae54fbc14 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 17 May 2018 13:16:26 +0200 Subject: player: use canonical playback time for video refreshes When changing video filters during initialization, there was a small time window where video was initialized, but playback restart was not complete yet. In this time window, playback_pts is not set. But since issue_refresh_seek() was using this, it could lead to no refresh being done _if_ the "video" had only 1 frame (such as cover art). Fix this by using get_current_time() instead, which is the current time with corner cases such as ongoing loading or seeks taken into account. See also the previous commit. Without that, get_current_time() could return NOPTS during init. Fixes #5831. --- player/misc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/player/misc.c b/player/misc.c index 88767ce2d0..f2e6f05173 100644 --- a/player/misc.c +++ b/player/misc.c @@ -200,10 +200,7 @@ void issue_refresh_seek(struct MPContext *mpctx, enum seek_precision min_prec) mp_wakeup_core(mpctx); return; } - // maybe happens when changing filters while file is loaded - ignore for now - if (mpctx->playback_pts == MP_NOPTS_VALUE) - return; - queue_seek(mpctx, MPSEEK_ABSOLUTE, mpctx->playback_pts, min_prec, 0); + queue_seek(mpctx, MPSEEK_ABSOLUTE, get_current_time(mpctx), min_prec, 0); } float mp_get_cache_percent(struct MPContext *mpctx) -- cgit v1.2.3