<html><head></head><body>Removing allocations looks like a step backward. It's not even correct for pointers.<br><br><div class="gmail_quote">Le 31 janvier 2019 11:57:02 GMT+02:00, Alexandre Janniaux <ajanni@videolabs.io> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail"><hr> modules/video_output/wayland/shm.c | 17 +++--------------<br> 1 file changed, 3 insertions(+), 14 deletions(-)<br><br>diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c<br>index 5616e6c6c1..b205be1c53 100644<br>--- a/modules/video_output/wayland/shm.c<br>+++ b/modules/video_output/wayland/shm.c<br>@@ -282,21 +282,14 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,<br> if (cfg->window->type != VOUT_WINDOW_TYPE_WAYLAND)<br> return VLC_EGENERIC;<br> <br>- vout_display_sys_t *sys = malloc(sizeof (*sys));<br>+ vout_display_sys_t *sys =<br>+ vd->sys = vlc_obj_calloc(VLC_OBJECT(vd), 1, sizeof (*sys));<br>+<br> if (unlikely(sys == NULL))<br> return VLC_ENOMEM;<br> <br>- vd->sys = sys;<br>- sys->embed = NULL;<br>- sys->eventq = NULL;<br>- sys->shm = NULL;<br>- sys->viewporter = NULL;<br>- sys->active_buffers = 0;<br>- sys->x = 0;<br>- sys->y = 0;<br> sys->display_width = cfg->display.width;<br> sys->display_height = cfg->display.height;<br>- sys->use_buffer_transform = false;<br> <br> /* Get window */<br> sys->embed = cfg->window;<br>@@ -326,8 +319,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,<br> struct wl_surface *surface = sys->embed->handle.wl;<br> if (sys->viewporter != NULL)<br> sys->viewport = wp_viewporter_get_viewport(sys->viewporter, surface);<br>- else<br>- sys->viewport = NULL;<br> <br> /* Determine our pixel format */<br> static const enum wl_output_transform transforms[8] = {<br>@@ -366,7 +357,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,<br> error:<br> if (sys->eventq != NULL)<br> wl_event_queue_destroy(sys->eventq);<br>- free(sys);<br> return VLC_EGENERIC;<br> }<br> <br>@@ -393,7 +383,6 @@ static void Close(vout_display_t *vd)<br> wl_shm_destroy(sys->shm);<br> wl_display_flush(display);<br> wl_event_queue_destroy(sys->eventq);<br>- free(sys);<br> }<br> <br> vlc_module_begin()</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>