summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2021-11-20 19:20:52 +0100
committerNiklas Haas <git@haasn.dev>2021-11-20 19:21:50 +0100
commit970061efdcbcb3ffb3d2abd95c85d65249913280 (patch)
treea40f459e20d20bd2a368d78a3e133d9350dc6aef
parentd2c2bf5a13bbaedd0f8c6ea8af227dffe95bdb40 (diff)
downloadmpv-970061efdcbcb3ffb3d2abd95c85d65249913280.tar.bz2
mpv-970061efdcbcb3ffb3d2abd95c85d65249913280.tar.xz
vo_gpu_next: fix OOM on wayland
Similar to ff0864d5f07d31c808014dbf1791ed3ec14644a8 Fixes #9484
-rw-r--r--video/out/vo_gpu_next.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 8a5f078939..1a02f27699 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -627,12 +627,6 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
p->last_id = id;
}
- // Doesn't draw anything. Only checks for visibility.
- struct ra_swapchain *sw = p->ra_ctx->swapchain;
- bool should_draw = sw->fns->start_frame(sw, NULL);
- if (!should_draw)
- return;
-
if (p->target_hint && frame->current) {
struct pl_swapchain_colors hint = get_csp_hint(vo, frame->current);
pl_swapchain_colorspace_hint(p->sw, &hint);
@@ -641,7 +635,9 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
}
struct pl_swapchain_frame swframe;
- if (!pl_swapchain_start_frame(p->sw, &swframe)) {
+ struct ra_swapchain *sw = p->ra_ctx->swapchain;
+ bool should_draw = sw->fns->start_frame(sw, NULL); // for wayland logic
+ if (!should_draw || !pl_swapchain_start_frame(p->sw, &swframe)) {
// Advance the queue state to the current PTS to discard unused frames
pl_queue_update(p->queue, NULL, &(struct pl_queue_params) {
.pts = frame->current->pts + frame->vsync_offset,