[vlc-commits] window: minor code factorization

Rémi Denis-Courmont git at videolan.org
Sat Apr 13 18:23:11 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 30 15:03:31 2019 +0200| [13a2c905735f308795e3c8bd05fa09a368840d86] | committer: Rémi Denis-Courmont

window: minor code factorization

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

 src/video_output/window.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/video_output/window.c b/src/video_output/window.c
index 3be9ab72e3..f6599b3eff 100644
--- a/src/video_output/window.c
+++ b/src/video_output/window.c
@@ -85,26 +85,19 @@ vout_window_t *vout_window_New(vlc_object_t *obj, const char *module,
 int vout_window_Enable(vout_window_t *window,
                        const vout_window_cfg_t *restrict cfg)
 {
-    window_t *w = container_of(window, window_t, wnd);
-
     if (window->ops->enable != NULL) {
         int err = window->ops->enable(window, cfg);
         if (err)
             return err;
     }
 
-    if (w->inhibit != NULL)
-        vlc_inhibit_Set(w->inhibit, VLC_INHIBIT_VIDEO);
-
+    vout_window_SetInhibition(window, true);
     return VLC_SUCCESS;
 }
 
 void vout_window_Disable(vout_window_t *window)
 {
-    window_t *w = container_of(window, window_t, wnd);
-
-    if (w->inhibit != NULL)
-        vlc_inhibit_Set(w->inhibit, VLC_INHIBIT_NONE);
+    vout_window_SetInhibition(window, false);
 
     if (window->ops->disable != NULL)
         window->ops->disable(window);



More information about the vlc-commits mailing list