mirror of https://github.com/mpv-player/mpv
vo_gpu_next: don't crash on !frame->current
This path incorrectly assumes there is a current frame.
This commit is contained in:
parent
431473310f
commit
8ef744d1b7
|
@ -885,11 +885,13 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
|
||||||
double vsync_offset = opts->interpolation ? frame->vsync_offset : 0;
|
double vsync_offset = opts->interpolation ? frame->vsync_offset : 0;
|
||||||
bool should_draw = sw->fns->start_frame(sw, NULL); // for wayland logic
|
bool should_draw = sw->fns->start_frame(sw, NULL); // for wayland logic
|
||||||
if (!should_draw || !pl_swapchain_start_frame(p->sw, &swframe)) {
|
if (!should_draw || !pl_swapchain_start_frame(p->sw, &swframe)) {
|
||||||
// Advance the queue state to the current PTS to discard unused frames
|
if (frame->current) {
|
||||||
pl_queue_update(p->queue, NULL, pl_queue_params(
|
// Advance the queue state to the current PTS to discard unused frames
|
||||||
.pts = frame->current->pts + vsync_offset,
|
pl_queue_update(p->queue, NULL, pl_queue_params(
|
||||||
.radius = pl_frame_mix_radius(&p->params),
|
.pts = frame->current->pts + vsync_offset,
|
||||||
));
|
.radius = pl_frame_mix_radius(&p->params),
|
||||||
|
));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue