* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: main.h,v 1.53 2003/02/17 05:50:31 sam Exp $
+ * $Id: main.h,v 1.54 2003/05/21 15:40:03 hartman Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
/* Locks */
vlc_mutex_t config_lock; /* lock for the config file */
+#ifdef SYS_DARWIN
+ vlc_mutex_t quicktime_lock; /* QT is not thread safe on OSX */
+#endif
};
* quicktime.c: a quicktime decoder that uses the QT library/dll
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: quicktime.c,v 1.1 2003/05/20 21:35:52 hartman Exp $
+ * $Id: quicktime.c,v 1.2 2003/05/21 15:40:03 hartman Exp $
*
* Authors: Laurent Aimar <fenrir at via.ecp.fr>
* Derk-Jan Hartman <thedj at users.sf.net>
p_dec->OutputFormatInfo.sampleRate = p_wf->nSamplesPerSec;
p_dec->OutputFormatInfo.format = FCC( 'N', 'O', 'N', 'E' );
+#ifdef SYS_DARWIN
+/* on OS X QT is not threadsafe */
+ vlc_mutex_lock( &p_dec->p_fifo->p_vlc->quicktime_lock );
+#endif
+
i_error = p_dec->SoundConverterOpen( &p_dec->InputFormatInfo,
&p_dec->OutputFormatInfo,
&p_dec->myConverter );
+#ifdef SYS_DARWIN
+ vlc_mutex_unlock( &p_dec->p_fifo->p_vlc->quicktime_lock );
+#endif
+
if( i_error )
{
msg_Dbg( p_dec->p_fifo, "error while SoundConverterOpen = %d", i_error );
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
- * $Id: vout.m,v 1.47 2003/05/05 22:04:11 hartman Exp $
+ * $Id: vout.m,v 1.48 2003/05/21 15:40:03 hartman Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
if( vout_ChromaCmp( p_vout->render.i_chroma, VLC_FOURCC('I','4','2','0') ) )
{
+ /* Damn QT isn't thread safe. so keep a lock in the p_vlc object */
+ vlc_mutex_lock( &p_vout->p_vlc->quicktime_lock );
+
err = FindCodec( kYUV420CodecType, bestSpeedCodec,
nil, &p_vout->p_sys->img_dc );
+
+ vlc_mutex_unlock( &p_vout->p_vlc->quicktime_lock );
if( err == noErr && p_vout->p_sys->img_dc != 0 )
{
p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0');
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.86 2003/05/11 13:14:04 sigmunau Exp $
+ * $Id: libvlc.c,v 1.87 2003/05/21 15:40:03 hartman Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/* Initialize mutexes */
vlc_mutex_init( p_vlc, &p_vlc->config_lock );
+#ifdef SYS_DARWIN
+ vlc_mutex_init( p_vlc, &p_vlc->quicktime_lock );
+#endif
/* Store our newly allocated structure in the global list */
vlc_object_attach( p_vlc, &libvlc );
/* Destroy mutexes */
vlc_mutex_destroy( &p_vlc->config_lock );
+#ifdef SYS_DARWIN
+ vlc_mutex_destroy( &p_vlc->quicktime_lock );
+#endif
vlc_object_detach( p_vlc );