[vlc-commits] wl/shm: keep shared memory pool
Rémi Denis-Courmont
git at videolan.org
Wed Dec 12 21:29:26 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 12 21:27:26 2018 +0200| [cb450073ad1b18105b9f33bf620ba1556bbf4a69] | committer: Rémi Denis-Courmont
wl/shm: keep shared memory pool
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cb450073ad1b18105b9f33bf620ba1556bbf4a69
---
modules/video_output/wayland/shm.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 6773dc7db6..da8c85656d 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -49,6 +49,7 @@ struct vout_display_sys_t
vout_window_t *embed; /* VLC window */
struct wl_event_queue *eventq;
struct wl_shm *shm;
+ struct wl_shm_pool *shm_pool;
struct wp_viewporter *viewporter;
struct wp_viewport *viewport;
@@ -125,9 +126,9 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
memset(base, 0x80, length); /* gray fill */
#endif
- struct wl_shm_pool *shm_pool = wl_shm_create_pool(sys->shm, fd, length);
+ sys->shm_pool = wl_shm_create_pool(sys->shm, fd, length);
vlc_close(fd);
- if (shm_pool == NULL)
+ if (sys->shm_pool == NULL)
{
munmap(base, length);
return NULL;
@@ -155,7 +156,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
{
struct wl_buffer *buf;
- buf = wl_shm_pool_create_buffer(shm_pool, offset, width, height,
+ buf = wl_shm_pool_create_buffer(sys->shm_pool, offset, width, height,
stride, WL_SHM_FORMAT_XRGB8888);
if (buf == NULL)
break;
@@ -177,7 +178,6 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
pics[count++] = pic;
}
- wl_shm_pool_destroy(shm_pool);
wl_display_flush(sys->embed->display.wl);
if (length > 0)
@@ -260,6 +260,7 @@ static void ResetPictures(vout_display_t *vd)
if (sys->pool == NULL)
return;
+ wl_shm_pool_destroy(sys->shm_pool);
wl_surface_attach(surface, NULL, 0, 0);
wl_surface_commit(surface);
More information about the vlc-commits
mailing list