From 761eeacf5407cab07a48e63d3dc215facf4d9650 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Jun 2016 13:57:46 +0200 Subject: vo_opengl: unmap hwdec images once rendering is done Instead of keeping them for a while. While keeping the mapping was perfectly ok, nothing speaks against reducing the time they're mapped. --- video/out/opengl/video.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 3b99ba95ca..fc05b9256d 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -845,7 +845,8 @@ static void init_video(struct gl_video *p) gl_video_setup_hooks(p); } -static void unref_current_image(struct gl_video *p) +// Release any texture mappings associated with the current frame. +static void unmap_current_image(struct gl_video *p) { struct video_image *vimg = &p->image; @@ -856,7 +857,12 @@ static void unref_current_image(struct gl_video *p) memset(vimg->planes, 0, sizeof(vimg->planes)); vimg->hwdec_mapped = false; } - mp_image_unrefp(&vimg->mpi); +} + +static void unref_current_image(struct gl_video *p) +{ + unmap_current_image(p); + mp_image_unrefp(&p->image.mpi); } static void uninit_video(struct gl_video *p) @@ -2802,6 +2808,8 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo) done: + unmap_current_image(p); + debug_check_gl(p, "after video rendering"); gl->BindFramebuffer(GL_FRAMEBUFFER, fbo); -- cgit v1.2.3