summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-11-06 15:27:03 -0600
committerDudemanguy <random342@airmail.cc>2023-11-07 00:52:46 +0000
commitcf69fa03ca5c5dae0db79c6c96b148088180936a (patch)
treeace1ed8f42f6f4bcab6c48e47eb8204e07053bc5
parentbd4bf6e3836a11733bbebc70002187b2f2ee37ae (diff)
downloadmpv-cf69fa03ca5c5dae0db79c6c96b148088180936a.tar.bz2
mpv-cf69fa03ca5c5dae0db79c6c96b148088180936a.tar.xz
vo: replace max swapchain depth magic number
-rw-r--r--options/options.c2
-rw-r--r--video/out/drm_common.c2
-rw-r--r--video/out/vo.h1
-rw-r--r--video/out/wayland_common.c4
-rw-r--r--video/out/x11_common.c2
5 files changed, 6 insertions, 5 deletions
diff --git a/options/options.c b/options/options.c
index 8597d39d7a..b217d10e56 100644
--- a/options/options.c
+++ b/options/options.c
@@ -216,7 +216,7 @@ static const m_option_t mp_vo_opt_list[] = {
#if HAVE_EGL_ANDROID
{"android-surface-size", OPT_SIZE_BOX(android_surface_size)},
#endif
- {"swapchain-depth", OPT_INT(swapchain_depth), M_RANGE(1, 8)},
+ {"swapchain-depth", OPT_INT(swapchain_depth), M_RANGE(1, VO_MAX_SWAPCHAIN_DEPTH)},
{"override-display-fps", OPT_REPLACED("display-fps-override")},
{0}
};
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);