]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/voutqt.m
Fix live detection on win32
[vlc] / modules / gui / macosx / voutqt.m
index a2ca07a1dadc05cc7a60e2a436eeebefaa61b350..61b1d76cef74e22e960556030e2d63099c2922e7 100644 (file)
@@ -114,7 +114,7 @@ static void QTFreePicture       ( vout_thread_t *, picture_t * );
  *****************************************************************************
  * This function allocates and initializes a MacOS X vout method.
  *****************************************************************************/
-int E_(OpenVideoQT) ( vlc_object_t *p_this )
+int OpenVideoQT ( vlc_object_t *p_this )
 {
     vout_thread_t * p_vout = (vout_thread_t *)p_this;
     OSErr err;
@@ -165,8 +165,8 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
-    /* Damn QT isn't thread safe. so keep a lock in the p_libvlc object */
-    vlc_mutex_lock( &p_vout->p_libvlc->quicktime_lock );
+    /* Damn QT isn't thread safe, so keep a process-wide lock */
+    vlc_mutex_t *p_qtlock = var_AcquireMutex( "quicktime_mutex" );
 
     /* Can we find the right chroma ? */
     if( p_vout->p_sys->b_cpu_has_simd )
@@ -179,7 +179,7 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
         err = FindCodec( kYUV420CodecType, bestSpeedCodec,
                         nil, &p_vout->p_sys->img_dc );
     }
-    vlc_mutex_unlock( &p_vout->p_libvlc->quicktime_lock );
+    vlc_mutex_unlock( p_qtlock );
  
     if( err == noErr && p_vout->p_sys->img_dc != 0 )
     {
@@ -232,7 +232,7 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
 /*****************************************************************************
  * CloseVideo: destroy video thread output method
  *****************************************************************************/
-void E_(CloseVideoQT) ( vlc_object_t *p_this )
+void CloseVideoQT ( vlc_object_t *p_this )
 {
     NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
     vout_thread_t * p_vout = (vout_thread_t *)p_this;