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

Rémi Denis-Courmont git at videolan.org
Thu Apr 21 23:17:59 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Apr 22 00:02:14 2016 +0300| [4d205167755802b39a3de21d7536b5ccf1bc3d21] | committer: Rémi Denis-Courmont

screen/wayland: use vlc_memfd()

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

 modules/access/screen/wayland.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/access/screen/wayland.c b/modules/access/screen/wayland.c
index adc6acc..3a3b015 100644
--- a/modules/access/screen/wayland.c
+++ b/modules/access/screen/wayland.c
@@ -38,6 +38,7 @@
 
 #include <vlc_common.h>
 #include <vlc_demux.h>
+#include <vlc_fs.h>
 #include <vlc_plugin.h>
 
 struct demux_sys_t
@@ -171,14 +172,12 @@ static block_t *Shoot(demux_t *demux)
 {
     demux_sys_t *sys = demux->p_sys;
 
-    char bufpath[] = "/tmp/"PACKAGE_NAME"XXXXXX";
-    int fd = mkostemp(bufpath, O_CLOEXEC);
+    int fd = vlc_memfd();
     if (fd == -1)
     {
         msg_Err(demux, "buffer creation error: %s", vlc_strerror_c(errno));
         return NULL;
     }
-    unlink(bufpath);
 
     /* NOTE: one extra line for overflow if screen-left > 0 */
     uint32_t pitch = 4u * sys->width;



More information about the vlc-commits mailing list