[vlc-commits] wayland/shm: use vlc_memfd()

Rémi Denis-Courmont git at videolan.org
Mon Aug 24 20:14:06 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 24 19:27:22 2015 +0300| [403d95438b9f942817fb2328e45f3067750d9770] | committer: Rémi Denis-Courmont

wayland/shm: use vlc_memfd()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=403d95438b9f942817fb2328e45f3067750d9770
---

 modules/video_output/wayland/shm.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 32a1f3e..66efa54 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -30,7 +30,6 @@
 #include <string.h>
 
 #include <sys/types.h>
-#include <fcntl.h>
 #include <sys/mman.h>
 #include <unistd.h>
 
@@ -41,6 +40,7 @@
 #include <vlc_plugin.h>
 #include <vlc_vout_display.h>
 #include <vlc_picture_pool.h>
+#include <vlc_fs.h>
 
 #define MAX_PICTURES 4
 
@@ -107,14 +107,12 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
     if (req > MAX_PICTURES)
         req = MAX_PICTURES;
 
-    char bufpath[] = "/tmp/"PACKAGE_NAME"XXXXXX";
-    int fd = mkostemp(bufpath, O_CLOEXEC);
+    int fd = vlc_memfd();
     if (fd == -1)
     {
         msg_Err(vd, "cannot create buffers: %s", vlc_strerror_c(errno));
         return NULL;
     }
-    unlink(bufpath);
 
     /* We need one extra line to cover for horizontal crop offset */
     unsigned stride = 4 * ((vd->fmt.i_width + 31) & ~31);



More information about the vlc-commits mailing list