summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/opengl/hwdec_drmprime_drm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/video/out/opengl/hwdec_drmprime_drm.c b/video/out/opengl/hwdec_drmprime_drm.c
index faa099a95e..e420bf4f33 100644
--- a/video/out/opengl/hwdec_drmprime_drm.c
+++ b/video/out/opengl/hwdec_drmprime_drm.c
@@ -50,7 +50,7 @@ struct priv {
struct mp_image_params params;
struct drm_atomic_context *ctx;
- struct drm_frame current_frame, old_frame;
+ struct drm_frame current_frame, last_frame, old_frame;
struct mp_rect src, dst;
@@ -71,8 +71,11 @@ static void set_current_frame(struct ra_hwdec *hw, struct drm_frame *frame)
drm_prime_destroy_framebuffer(p->log, p->ctx->fd, &p->old_frame.fb);
}
- mp_image_setrefp(&p->old_frame.image, p->current_frame.image);
- p->old_frame.fb = p->current_frame.fb;
+ mp_image_setrefp(&p->old_frame.image, p->last_frame.image);
+ p->old_frame.fb = p->last_frame.fb;
+
+ mp_image_setrefp(&p->last_frame.image, p->current_frame.image);
+ p->last_frame.fb = p->current_frame.fb;
if (frame) {
p->current_frame.fb = frame->fb;
@@ -80,6 +83,8 @@ static void set_current_frame(struct ra_hwdec *hw, struct drm_frame *frame)
} else {
memset(&p->current_frame.fb, 0, sizeof(p->current_frame.fb));
mp_image_setrefp(&p->current_frame.image, NULL);
+ mp_image_setrefp(&p->last_frame.image, NULL);
+ mp_image_setrefp(&p->old_frame.image, NULL);
}
}