[vlc-commits] wayland/shm: reorder code

Rémi Denis-Courmont git at videolan.org
Wed Jul 24 21:09:23 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 24 22:02:32 2019 +0300| [1094d0ab4725a81acd89d12f0be7581e3f3e60af] | committer: Rémi Denis-Courmont

wayland/shm: reorder code

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

 modules/video_output/wayland/shm.c | 52 +++++++++++++++++++-------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 6cea58d300..43e45f2dd8 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -272,6 +272,32 @@ static const struct wl_registry_listener registry_cbs =
     registry_global_remove_cb,
 };
 
+static void Close(vout_display_t *vd)
+{
+    vout_display_sys_t *sys = vd->sys;
+    struct wl_display *display = sys->embed->display.wl;
+    struct wl_surface *surface = sys->embed->handle.wl;
+
+    wl_surface_attach(surface, NULL, 0, 0);
+    wl_surface_commit(surface);
+
+    /* Wait until all picture buffers are released by the server */
+    while (sys->active_buffers > 0) {
+        msg_Dbg(vd, "%zu buffer(s) still active", sys->active_buffers);
+        wl_display_roundtrip_queue(display, sys->eventq);
+    }
+    msg_Dbg(vd, "no active buffers left");
+
+    if (sys->viewport != NULL)
+        wp_viewport_destroy(sys->viewport);
+    if (sys->viewporter != NULL)
+        wp_viewporter_destroy(sys->viewporter);
+    wl_shm_destroy(sys->shm);
+    wl_display_flush(display);
+    wl_event_queue_destroy(sys->eventq);
+    free(sys);
+}
+
 static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
                 video_format_t *fmtp, vlc_video_context *context)
 {
@@ -368,32 +394,6 @@ error:
     return VLC_EGENERIC;
 }
 
-static void Close(vout_display_t *vd)
-{
-    vout_display_sys_t *sys = vd->sys;
-    struct wl_display *display = sys->embed->display.wl;
-    struct wl_surface *surface = sys->embed->handle.wl;
-
-    wl_surface_attach(surface, NULL, 0, 0);
-    wl_surface_commit(surface);
-
-    /* Wait until all picture buffers are released by the server */
-    while (sys->active_buffers > 0) {
-        msg_Dbg(vd, "%zu buffer(s) still active", sys->active_buffers);
-        wl_display_roundtrip_queue(display, sys->eventq);
-    }
-    msg_Dbg(vd, "no active buffers left");
-
-    if (sys->viewport != NULL)
-        wp_viewport_destroy(sys->viewport);
-    if (sys->viewporter != NULL)
-        wp_viewporter_destroy(sys->viewporter);
-    wl_shm_destroy(sys->shm);
-    wl_display_flush(display);
-    wl_event_queue_destroy(sys->eventq);
-    free(sys);
-}
-
 vlc_module_begin()
     set_shortname(N_("WL SHM"))
     set_description(N_("Wayland shared memory video output"))



More information about the vlc-commits mailing list