summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-02-04 16:33:55 +0100
committerDudemanguy <random342@airmail.cc>2024-02-15 16:39:58 +0000
commit0bf4da0f5e70bd612644107f1634d2d4763ae4fc (patch)
tree8b25376acccc70a8313d2c687ee97a31b5367959
parent31a5f77ceb833d308f8c23ac0549be9d412081bc (diff)
downloadmpv-0bf4da0f5e70bd612644107f1634d2d4763ae4fc.tar.bz2
mpv-0bf4da0f5e70bd612644107f1634d2d4763ae4fc.tar.xz
Revert "vo: remove frame timing check from vo_still_displaying()"
This reverts commit ef11d31c3acfd71307a94e44ad164a4861287675.
-rw-r--r--video/out/vo.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index aa98bc8aea..31d96c600f 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -1202,9 +1202,16 @@ void vo_seek_reset(struct vo *vo)
bool vo_still_displaying(struct vo *vo)
{
struct vo_internal *in = vo->in;
- mp_mutex_lock(&in->lock);
- bool working = in->rendering || in->frame_queued;
- mp_mutex_unlock(&in->lock);
+ mp_mutex_lock(&vo->in->lock);
+ int64_t now = mp_time_ns();
+ 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;
+ mp_mutex_unlock(&vo->in->lock);
return working && in->hasframe;
}