summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-07-18 21:49:36 +0200
committerNiklas Haas <git@haasn.dev>2022-07-18 22:03:06 +0200
commit8ef744d1b7f64b3b7d814ee4d9376d6538befb73 (patch)
treea55ab3a9faef7abbfb75c455799d21ba170e3211
parent431473310f9d86f6ae030ce3432897edebe5ab89 (diff)
downloadmpv-8ef744d1b7f64b3b7d814ee4d9376d6538befb73.tar.bz2
mpv-8ef744d1b7f64b3b7d814ee4d9376d6538befb73.tar.xz
vo_gpu_next: don't crash on !frame->current
This path incorrectly assumes there is a current frame.
-rw-r--r--video/out/vo_gpu_next.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 2bdda0275f..0c3ef76cbd 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -885,11 +885,13 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
double vsync_offset = opts->interpolation ? frame->vsync_offset : 0;
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, pl_queue_params(
- .pts = frame->current->pts + vsync_offset,
- .radius = pl_frame_mix_radius(&p->params),
- ));
+ if (frame->current) {
+ // Advance the queue state to the current PTS to discard unused frames
+ pl_queue_update(p->queue, NULL, pl_queue_params(
+ .pts = frame->current->pts + vsync_offset,
+ .radius = pl_frame_mix_radius(&p->params),
+ ));
+ }
return;
}