diff options
Diffstat (limited to 'video/out/present_sync.c')
-rw-r--r-- | video/out/present_sync.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/video/out/present_sync.c b/video/out/present_sync.c index 75004f56b5..e527f8cf98 100644 --- a/video/out/present_sync.c +++ b/video/out/present_sync.c @@ -57,13 +57,14 @@ void present_sync_get_info(struct mp_present *present, struct vo_vsync_info *inf LL_APPEND(list_node, present, cur); } -struct mp_present *mp_present_initialize(void *talloc_ctx, int entries) +struct mp_present *mp_present_initialize(void *talloc_ctx, struct mp_vo_opts *opts, int entries) { struct mp_present *present = talloc_zero(talloc_ctx, struct mp_present); for (int i = 0; i < entries; i++) { struct mp_present_entry *entry = talloc_zero(present, struct mp_present_entry); LL_APPEND(list_node, present, entry); } + present->opts = opts; return present; } @@ -120,8 +121,9 @@ void present_sync_update_values(struct mp_present *present, int64_t ust, int64_t msc) { struct mp_present_entry *cur = present->head; - while (cur) { - if (!cur->ust) + int index = 0; + while (cur && ++index) { + if (!cur->ust || index == present->opts->swapchain_depth) break; cur = cur->list_node.next; } |