Reduced a lock visibility to directx only (msw).
authorLaurent Aimar <fenrir@videolan.org>
Thu, 1 Oct 2009 20:01:07 +0000 (22:01 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 1 Oct 2009 20:02:52 +0000 (22:02 +0200)
It was useless for all other vout modules.

modules/video_output/msw/common.c
modules/video_output/msw/directx.c
modules/video_output/msw/vout.h

index 262d196..ff7466f 100644 (file)
@@ -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 );
index ae27d9e..96b16b5 100644 (file)
@@ -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 );
 }
 
index fb0689b..e2c5065 100644 (file)
@@ -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