From cf69fa03ca5c5dae0db79c6c96b148088180936a Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 6 Nov 2023 15:27:03 -0600 Subject: vo: replace max swapchain depth magic number --- video/out/drm_common.c | 2 +- video/out/vo.h | 1 + video/out/wayland_common.c | 4 ++-- video/out/x11_common.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'video/out') diff --git a/video/out/drm_common.c b/video/out/drm_common.c index cc53757e43..2b68bac2ff 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -1030,7 +1030,7 @@ bool vo_drm_init(struct vo *vo) drm->ev.version = DRM_EVENT_CONTEXT_VERSION; drm->ev.page_flip_handler = &drm_pflip_cb; - drm->present = mp_present_initialize(drm, 8); // max swapchain depth allowed + drm->present = mp_present_initialize(drm, VO_MAX_SWAPCHAIN_DEPTH); return true; diff --git a/video/out/vo.h b/video/out/vo.h index 6b832b28e8..a643830e1b 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -192,6 +192,7 @@ enum { }; #define VO_MAX_REQ_FRAMES 10 +#define VO_MAX_SWAPCHAIN_DEPTH 8 struct vo; struct osd_state; diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 381a934c30..fa6356084c 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -2280,10 +2280,10 @@ bool vo_wayland_init(struct vo *vo) if (wl->presentation) { wl->fback_pool = talloc_zero(wl, struct vo_wayland_feedback_pool); wl->fback_pool->wl = wl; - wl->fback_pool->len = 8; // max swapchain depth allowed + wl->fback_pool->len = VO_MAX_SWAPCHAIN_DEPTH; wl->fback_pool->fback = talloc_zero_array(wl->fback_pool, struct wp_presentation_feedback *, wl->fback_pool->len); - wl->present = mp_present_initialize(wl, 8); // max swapchain depth allowed + wl->present = mp_present_initialize(wl, VO_MAX_SWAPCHAIN_DEPTH); } else { MP_VERBOSE(wl, "Compositor doesn't support the %s protocol!\n", wp_presentation_interface.name); diff --git a/video/out/x11_common.c b/video/out/x11_common.c index f221471255..f0f859d6f6 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -626,7 +626,7 @@ bool vo_x11_init(struct vo *vo) x11_error_output = x11->log; XSetErrorHandler(x11_errorhandler); - x11->present = mp_present_initialize(x11, 8); // max swapchain depth allowed + x11->present = mp_present_initialize(x11, VO_MAX_SWAPCHAIN_DEPTH); dispName = XDisplayName(NULL); -- cgit v1.2.3