[vlc-devel] commit: Reduced a lock visibility to directx only (msw). (Laurent Aimar )

git version control git at videolan.org
Thu Oct 1 22:03:30 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Oct  1 22:01:07 2009 +0200| [1c795114623bba43d22b436094531567dd0cb0da] | committer: Laurent Aimar 

Reduced a lock visibility to directx only (msw).

It was useless for all other vout modules.

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

 modules/video_output/msw/common.c  |   10 ----------
 modules/video_output/msw/directx.c |    2 ++
 modules/video_output/msw/vout.h    |    2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c
index 262d196..ff7466f 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -84,7 +84,6 @@ int CommonInit( vout_thread_t *p_vout )
     p_sys->i_changes = 0;
     SetRectEmpty( &p_sys->rect_display );
     SetRectEmpty( &p_sys->rect_parent );
-    vlc_mutex_init( &p_sys->lock );
 
     var_Create( p_vout, "video-title", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
 
@@ -145,8 +144,6 @@ void CommonClean( vout_thread_t *p_vout )
         EventThreadDestroy( p_sys->p_event );
     }
 
-    vlc_mutex_destroy( &p_sys->lock );
-
 #if !defined(UNDER_CE) && !defined(MODULE_NAME_IS_glwin32)
     RestoreScreensaver( p_vout );
 #endif
@@ -156,14 +153,11 @@ void CommonManage( vout_thread_t *p_vout )
 {
     /* If we do not control our window, we check for geometry changes
      * ourselves because the parent might not send us its events. */
-    vlc_mutex_lock( &p_vout->p_sys->lock );
     if( p_vout->p_sys->hparent && !p_vout->b_fullscreen )
     {
         RECT rect_parent;
         POINT point;
 
-        vlc_mutex_unlock( &p_vout->p_sys->lock );
-
         GetClientRect( p_vout->p_sys->hparent, &rect_parent );
         point.x = point.y = 0;
         ClientToScreen( p_vout->p_sys->hparent, &point );
@@ -204,10 +198,6 @@ void CommonManage( vout_thread_t *p_vout )
 #endif
         }
     }
-    else
-    {
-        vlc_mutex_unlock( &p_vout->p_sys->lock );
-    }
 
     /* */
     p_vout->p_sys->i_changes |= EventThreadRetreiveChanges( p_vout->p_sys->p_event );
diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index ae27d9e..96b16b5 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -218,6 +218,7 @@ static int OpenVideo( vlc_object_t *p_this )
     p_vout->p_sys = calloc( 1, sizeof( vout_sys_t ) );
     if( p_vout->p_sys == NULL )
         return VLC_ENOMEM;
+    vlc_mutex_init( &p_vout->p_sys->lock );
 
     /* Initialisations */
     p_vout->pf_init = Init;
@@ -431,6 +432,7 @@ static void CloseVideo( vlc_object_t *p_this )
 
     CommonClean( p_vout );
 
+    vlc_mutex_destroy( &p_vout->p_sys->lock );
     free( p_vout->p_sys );
 }
 
diff --git a/modules/video_output/msw/vout.h b/modules/video_output/msw/vout.h
index fb0689b..e2c5065 100644
--- a/modules/video_output/msw/vout.h
+++ b/modules/video_output/msw/vout.h
@@ -140,6 +140,7 @@ struct vout_sys_t
     LPDIRECTDRAWSURFACE2 p_current_surface;   /* surface currently displayed */
     LPDIRECTDRAWCLIPPER  p_clipper;             /* clipper used for blitting */
     HINSTANCE            hddraw_dll;       /* handle of the opened ddraw dll */
+    vlc_mutex_t    lock;
 #endif
 
 #ifdef MODULE_NAME_IS_glwin32
@@ -207,7 +208,6 @@ struct vout_sys_t
 #endif
 
     event_thread_t *p_event;
-    vlc_mutex_t    lock;
 };
 
 #ifdef MODULE_NAME_IS_wingapi




More information about the vlc-devel mailing list