diff options
author | wm4 <wm4@nowhere> | 2020-06-01 15:08:24 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-06-01 15:21:41 +0200 |
commit | 57462580180ecc9006b625b94e895a38e1118f69 (patch) | |
tree | 1da2d6c8af1cbcb176eda8e325a8fd108765e24b | |
parent | d27ad9654218463694093697e3d09f8983b4ccf3 (diff) | |
download | mpv-57462580180ecc9006b625b94e895a38e1118f69.tar.bz2 mpv-57462580180ecc9006b625b94e895a38e1118f69.tar.xz |
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)
-rw-r--r-- | video/out/vo.c | 6 |
1 files 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) |