[vlc-devel] commit: Moved a lock creation to CreateEventThread. (Laurent Aimar )

git version control git at videolan.org
Mon Sep 14 20:20:01 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Sep  7 22:40:10 2009 +0200| [3540bb57899529f4224e20ba17a9d42b2d1ad12a] | committer: Laurent Aimar 

Moved a lock creation to CreateEventThread.

It is more symetric with StopEventThread.

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

 modules/video_output/msw/direct3d.c |    1 -
 modules/video_output/msw/directx.c  |    1 -
 modules/video_output/msw/events.c   |    3 +++
 modules/video_output/msw/glwin32.c  |    1 -
 modules/video_output/msw/wingdi.c   |    1 -
 5 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index 38c2976..6b5758d 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -197,7 +197,6 @@ static int OpenVideo( vlc_object_t *p_this )
     p_vout->p_sys->hparent = p_vout->p_sys->hfswnd = NULL;
     p_vout->p_sys->i_changes = 0;
     p_vout->p_sys->b_desktop = false;
-    vlc_mutex_init( &p_vout->p_sys->lock );
     SetRectEmpty( &p_vout->p_sys->rect_display );
     SetRectEmpty( &p_vout->p_sys->rect_parent );
 
diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index f740852..5b3e6da 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -234,7 +234,6 @@ static int OpenVideo( vlc_object_t *p_this )
     p_vout->p_sys->hparent = p_vout->p_sys->hfswnd = NULL;
     p_vout->p_sys->i_changes = 0;
     p_vout->p_sys->b_wallpaper = 0;
-    vlc_mutex_init( &p_vout->p_sys->lock );
     SetRectEmpty( &p_vout->p_sys->rect_display );
     SetRectEmpty( &p_vout->p_sys->rect_parent );
 
diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index cb7356c..bbf5931 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -1334,6 +1334,9 @@ void RestoreScreensaver( vout_thread_t *p_vout )
 
 int CreateEventThread( vout_thread_t *p_vout )
 {
+    if( !( p_vout->p_sys->i_changes & SWITCHING_MODE_FLAG ) )
+        vlc_mutex_init( &p_vout->p_sys->lock );
+
     /* Create the Vout EventThread, this thread is created by us to isolate
      * the Win32 PeekMessage function calls. We want to do this because
      * Windows can stay blocked inside this call for a long time, and when
diff --git a/modules/video_output/msw/glwin32.c b/modules/video_output/msw/glwin32.c
index 38a7b19..6f279d3 100644
--- a/modules/video_output/msw/glwin32.c
+++ b/modules/video_output/msw/glwin32.c
@@ -106,7 +106,6 @@ static int OpenVideo( vlc_object_t *p_this )
     p_vout->p_sys->hwnd = p_vout->p_sys->hvideownd = NULL;
     p_vout->p_sys->hparent = p_vout->p_sys->hfswnd = NULL;
     p_vout->p_sys->i_changes = 0;
-    vlc_mutex_init( &p_vout->p_sys->lock );
     SetRectEmpty( &p_vout->p_sys->rect_display );
     SetRectEmpty( &p_vout->p_sys->rect_parent );
 
diff --git a/modules/video_output/msw/wingdi.c b/modules/video_output/msw/wingdi.c
index 16214d0..e6ad270 100644
--- a/modules/video_output/msw/wingdi.c
+++ b/modules/video_output/msw/wingdi.c
@@ -165,7 +165,6 @@ static int OpenVideo ( vlc_object_t *p_this )
     p_vout->p_sys->hwnd = p_vout->p_sys->hvideownd = NULL;
     p_vout->p_sys->hparent = p_vout->p_sys->hfswnd = NULL;
     p_vout->p_sys->i_changes = 0;
-    vlc_mutex_init( &p_vout->p_sys->lock );
     SetRectEmpty( &p_vout->p_sys->rect_display );
     SetRectEmpty( &p_vout->p_sys->rect_parent );
 




More information about the vlc-devel mailing list