[vlc-commits] display: remove explicit window deletions

Rémi Denis-Courmont git at videolan.org
Sun May 20 19:51:44 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 16 23:00:00 2018 +0300| [5b3cb0ebd304d5920b636c377db94a0f45b772a9] | committer: Rémi Denis-Courmont

display: remove explicit window deletions

Now that the video splitter also creates windows up-front and keeps
them, there is no point in deleting windows explicitly when a display
fails initialization or is destroyed.

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

 modules/hw/vdpau/display.c             | 3 ---
 modules/video_output/android/display.c | 7 -------
 modules/video_output/caopengllayer.m   | 3 ---
 modules/video_output/kva.c             | 2 --
 modules/video_output/macosx.m          | 2 --
 modules/video_output/opengl/display.c  | 4 ----
 modules/video_output/wayland/shm.c     | 3 ---
 modules/video_output/win32/events.c    | 4 ----
 modules/video_output/xcb/events.c      | 1 -
 modules/video_output/xcb/x11.c         | 1 -
 modules/video_output/xcb/xvideo.c      | 1 -
 11 files changed, 31 deletions(-)

diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 7a463a1a9e..a89036f795 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -441,7 +441,6 @@ static int Open(vlc_object_t *obj)
     {
         msg_Dbg(obj, "device creation failure: error %d", (int)err);
         xcb_disconnect(sys->conn);
-        vout_display_DeleteWindow(vd, sys->embed);
         free(sys);
         return VLC_EGENERIC;
     }
@@ -661,7 +660,6 @@ static int Open(vlc_object_t *obj)
 error:
     vdp_release_x11(sys->vdp);
     xcb_disconnect(sys->conn);
-    vout_display_DeleteWindow(vd, sys->embed);
     free(sys);
     return VLC_EGENERIC;
 }
@@ -679,6 +677,5 @@ static void Close(vlc_object_t *obj)
 
     vdp_release_x11(sys->vdp);
     xcb_disconnect(sys->conn);
-    vout_display_DeleteWindow(vd, sys->embed);
     free(sys);
 }
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 97ebf5d479..1c89f69342 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -525,17 +525,13 @@ static int OpenCommon(vout_display_t *vd)
     {
         /* It's better to use gles2 if we are not able to change the video
          * layout */
-        vout_display_DeleteWindow(vd, embed);
         return VLC_EGENERIC;
     }
 
     /* Allocate structure */
     vd->sys = sys = (struct vout_display_sys_t*)calloc(1, sizeof(*sys));
     if (!sys)
-    {
-        vout_display_DeleteWindow(vd, embed);
         return VLC_ENOMEM;
-    }
 
     sys->embed = embed;
     sys->p_awh = p_awh;
@@ -719,10 +715,7 @@ static void Close(vlc_object_t *p_this)
         AndroidWindow_Destroy(vd, sys->p_sub_window);
 
     if (sys->embed)
-    {
         AWindowHandler_setVideoLayout(sys->p_awh, 0, 0, 0, 0, 0, 0);
-        vout_display_DeleteWindow(vd, sys->embed);
-    }
 
     free(sys);
 }
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 003fd99348..47af29a49f 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -249,9 +249,6 @@ static void Close (vlc_object_t *p_this)
     if (sys->container)
         [sys->container release];
 
-    if (sys->embed)
-        vout_display_DeleteWindow(vd, sys->embed);
-
     if (sys->vgl != NULL && !OpenglLock(sys->gl)) {
         vout_display_opengl_Delete(sys->vgl);
         OpenglUnlock(sys->gl);
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 151d3dea62..2dc8c4ba04 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -302,8 +302,6 @@ exit_kva_init :
     WinDestroyWindow( sys->frame );
 
 exit_frame :
-    vout_display_DeleteWindow( vd, sys->parent_window );
-
     if( sys->is_mouse_hidden )
         WinShowPointer( HWND_DESKTOP, TRUE );
 
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 10c7dc5b12..0a40198b6e 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -300,8 +300,6 @@ void Close (vlc_object_t *this)
 
         [sys->glView release];
 
-        if (sys->embed)
-            vout_display_DeleteWindow (vd, sys->embed);
         free (sys);
     }
 }
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index 328d096d2d..d0335d5a50 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -162,8 +162,6 @@ static int Open (vlc_object_t *obj)
 error:
     if (sys->gl != NULL)
         vlc_gl_Release (sys->gl);
-    if (surface != NULL)
-        vout_display_DeleteWindow (vd, surface);
     free (sys);
     return VLC_EGENERIC;
 }
@@ -176,14 +174,12 @@ static void Close (vlc_object_t *obj)
     vout_display_t *vd = (vout_display_t *)obj;
     vout_display_sys_t *sys = vd->sys;
     vlc_gl_t *gl = sys->gl;
-    vout_window_t *surface = gl->surface;
 
     vlc_gl_MakeCurrent (gl);
     vout_display_opengl_Delete (sys->vgl);
     vlc_gl_ReleaseCurrent (gl);
 
     vlc_gl_Release (gl);
-    vout_display_DeleteWindow (vd, surface);
     free (sys);
 }
 
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 7ae202bfe1..e3919f2d3c 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -482,8 +482,6 @@ static int Open(vlc_object_t *obj)
 error:
     if (sys->eventq != NULL)
         wl_event_queue_destroy(sys->eventq);
-    if (sys->embed != NULL)
-        vout_display_DeleteWindow(vd, sys->embed);
     free(sys);
     return VLC_EGENERIC;
 }
@@ -502,7 +500,6 @@ static void Close(vlc_object_t *obj)
     wl_shm_destroy(sys->shm);
     wl_display_flush(sys->embed->display.wl);
     wl_event_queue_destroy(sys->eventq);
-    vout_display_DeleteWindow(vd, sys->embed);
     free(sys);
 }
 
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index a8beb9fc9e..a911dbc6d6 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -884,10 +884,6 @@ static void Win32VoutCloseWindow( event_thread_t *p_event )
     if( p_event->hfswnd )
         DestroyWindow( p_event->hfswnd );
 
-    #if defined(MODULE_NAME_IS_direct3d9) || defined(MODULE_NAME_IS_direct3d11)
-    if( !p_event->use_desktop )
-    #endif
-        vout_display_DeleteWindow( vd, p_event->parent_window );
     p_event->hwnd = NULL;
 
     HINSTANCE hInstance = GetModuleHandle(NULL);
diff --git a/modules/video_output/xcb/events.c b/modules/video_output/xcb/events.c
index 16ff8cbaee..907414572a 100644
--- a/modules/video_output/xcb/events.c
+++ b/modules/video_output/xcb/events.c
@@ -136,7 +136,6 @@ vout_window_t *vlc_xcb_parent_Create(vout_display_t *vd,
 error:
     if (conn != NULL)
         xcb_disconnect (conn);
-    vout_display_DeleteWindow (vd, wnd);
     return NULL;
 }
 
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index ef671c84f5..7567b3b891 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -325,7 +325,6 @@ static void Close (vlc_object_t *obj)
 
     /* colormap, window and context are garbage-collected by X */
     xcb_disconnect (sys->conn);
-    vout_display_DeleteWindow (vd, sys->embed);
     free (sys);
 }
 
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index 0836929fba..da0e5f76ff 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -588,7 +588,6 @@ static void Close (vlc_object_t *obj)
 
     free (p_sys->att);
     xcb_disconnect (p_sys->conn);
-    vout_display_DeleteWindow (vd, p_sys->embed);
     free (p_sys);
 }
 



More information about the vlc-commits mailing list