diff options
author | wm4 <wm4@nowhere> | 2016-06-20 13:57:46 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-06-20 13:57:46 +0200 |
commit | 761eeacf5407cab07a48e63d3dc215facf4d9650 (patch) | |
tree | 80ee91d2332040caee9c44e673dd7b4df8e5a667 /video | |
parent | 7be37337f4ceb5dd663f287f1601f704d3d42d73 (diff) | |
download | mpv-761eeacf5407cab07a48e63d3dc215facf4d9650.tar.bz2 mpv-761eeacf5407cab07a48e63d3dc215facf4d9650.tar.xz |
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.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/opengl/video.c | 12 |
1 files 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); |