From 57462580180ecc9006b625b94e895a38e1118f69 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 1 Jun 2020 15:08:24 +0200 Subject: vo: refine wakeup condition, and wake up more in audio sync mode Commit 6a13954d67143fb lowered the frequency of wakeups with this condition. But it seems it sometimes the audio sync mode really should get the wakeup before the frame is rendered. Normally, vo_thread is supposed to perform this wakeup. Now the wakeup frequency is twice of what should be needed - whatever, maybe it can be fixed properly once or if timing is moved to the VO entirely in the future. Fixes: #7777 (probably, untested) --- video/out/vo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/video/out/vo.c b/video/out/vo.c index 68aff6eccb..27be4735ab 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -939,9 +939,9 @@ static bool render_frame(struct vo *vo) in->hasframe_rendered = true; int64_t prev_drop_count = vo->in->drop_count; // Can the core queue new video now? Non-display-sync uses a separate - // timer instead. - bool can_queue = - !in->frame_queued && in->current_frame->num_vsyncs < 1 && use_vsync; + // timer instead, but possibly benefits from preparing a frame early. + bool can_queue = !in->frame_queued && + (in->current_frame->num_vsyncs < 1 || !use_vsync); pthread_mutex_unlock(&in->lock); if (can_queue) -- cgit v1.2.3