From 1afc0c8b559d70a3764c8c791286553ad6677bc0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 30 Oct 2016 12:00:33 +0100 Subject: [PATCH] vo_opengl_cb: update current frame if a frame is dropped Even if a frame is dropped due to the libmpv API user not drawing a frame, it should be set as current frame. This avoids dropping a frame forever in certain circumstances such as cover art of the API user was stuck at initialization or such. --- video/out/vo_opengl_cb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c index 20e9523cb0..8d2af31491 100644 --- a/video/out/vo_opengl_cb.c +++ b/video/out/vo_opengl_cb.c @@ -399,7 +399,8 @@ done: // Cleanup after the API user is not reacting, or is being unusually slow. if (p->ctx->next_frame) { - talloc_free(p->ctx->next_frame); + talloc_free(p->ctx->cur_frame); + p->ctx->cur_frame = p->ctx->next_frame; p->ctx->next_frame = NULL; p->ctx->present_count += 2; pthread_cond_signal(&p->ctx->wakeup);