From ef11d31c3acfd71307a94e44ad164a4861287675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 6 Oct 2023 22:55:02 +0200 Subject: [PATCH] vo: remove frame timing check from vo_still_displaying() This timing dependency does not guarantee that we will wake up in the future, depending on processing times. --- video/out/vo.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/video/out/vo.c b/video/out/vo.c index 0130ae4387..669595f1ce 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -1182,16 +1182,9 @@ void vo_seek_reset(struct vo *vo) bool vo_still_displaying(struct vo *vo) { struct vo_internal *in = vo->in; - pthread_mutex_lock(&vo->in->lock); - int64_t now = mp_time_us(); - int64_t frame_end = 0; - if (in->current_frame) { - frame_end = in->current_frame->pts + MPMAX(in->current_frame->duration, 0); - if (in->current_frame->display_synced) - frame_end = in->current_frame->num_vsyncs > 0 ? INT64_MAX : 0; - } - bool working = now < frame_end || in->rendering || in->frame_queued; - pthread_mutex_unlock(&vo->in->lock); + pthread_mutex_lock(&in->lock); + bool working = in->rendering || in->frame_queued; + pthread_mutex_unlock(&in->lock); return working && in->hasframe; }