[vlc-commits] vout: fix double mutex destroy

Thomas Guillem git at videolan.org
Fri May 3 13:50:17 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Apr 16 11:40:23 2019 +0200| [99fb8bf18dc98b106bd727cefaed82af93d7ab45] | committer: Francois Cartegnie

vout: fix double mutex destroy

And move window deletion from vout_Close() to vout_Release(). That way, the
window is always valid during the lifetime of the vout. This simplify window
NULL checks.

Note: vout_IntfDeinit() is called from vout_Close(). So, theoretically, no
functions touching the window can be called after this call. This may change in
the future if we want to control the vout from functions directly.

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

 src/video_output/video_output.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 9604522825..5681acb9aa 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1690,9 +1690,6 @@ void vout_Close(vout_thread_t *vout)
     vout_control_Dead(&sys->control);
     vout_chrono_Clean(&sys->render);
 
-    vlc_mutex_destroy(&sys->window_lock);
-    vout_display_window_Delete(sys->display_cfg.window);
-
     vlc_mutex_lock(&sys->spu_lock);
     spu_Destroy(sys->spu);
     sys->spu = NULL;
@@ -1714,6 +1711,9 @@ void vout_Release(vout_thread_t *vout)
     vlc_mutex_destroy(&vout->p->window_lock);
     vlc_mutex_destroy(&vout->p->spu_lock);
     vlc_mutex_destroy(&vout->p->filter.lock);
+
+    vout_display_window_Delete(sys->display_cfg.window);
+
     vout_control_Clean(&vout->p->control);
 
     /* */



More information about the vlc-commits mailing list