summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2021-11-07 11:00:48 +0100
committerNiklas Haas <github-daiK1o@haasn.dev>2021-11-08 18:24:11 +0100
commitff0864d5f07d31c808014dbf1791ed3ec14644a8 (patch)
tree88446059317ac139e3f45baea7017113a63bf508
parentf5d545c9174216339defc222e54d419d631f5805 (diff)
downloadmpv-ff0864d5f07d31c808014dbf1791ed3ec14644a8.tar.bz2
mpv-ff0864d5f07d31c808014dbf1791ed3ec14644a8.tar.xz
vo_gpu_next: fix resource exhaustion on minimized windows
This required an upstream API change to implement in a way that doesn't unnecessarily re-push or upload frames that won't be used. I consider this a big enough bug to justify bumping the minimum version for it. Closes #9401
-rw-r--r--video/out/vo_gpu_next.c10
-rw-r--r--wscript4
2 files changed, 10 insertions, 4 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index a462cdc68a..0760a070ef 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -583,8 +583,14 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
return;
struct pl_swapchain_frame swframe;
- if (!pl_swapchain_start_frame(p->sw, &swframe))
+ if (!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,
+ .radius = pl_frame_mix_radius(&p->params),
+ });
return;
+ }
bool valid = false;
p->is_interpolated = false;
@@ -616,7 +622,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
tbits->sample_depth = opts->dither_depth;
}
- struct pl_frame_mix mix = {0};
+ struct pl_frame_mix mix;
if (frame->current) {
// Update queue state
struct pl_queue_params qparams = {
diff --git a/wscript b/wscript
index 89b8603170..dec82d3465 100644
--- a/wscript
+++ b/wscript
@@ -741,9 +741,9 @@ video_output_features = [
'func': check_pkg_config('libplacebo >= 3.104.0'),
}, {
'name': 'libplacebo-v4',
- 'desc': 'libplacebo v4.157+, needed for vo_gpu_next',
+ 'desc': 'libplacebo v4.170+, needed for vo_gpu_next',
'deps': 'libplacebo',
- 'func': check_preprocessor('libplacebo/config.h', 'PL_API_VER >= 157',
+ 'func': check_preprocessor('libplacebo/config.h', 'PL_API_VER >= 170',
use='libplacebo'),
}, {
'name': '--vulkan',