static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static void QteMain ( qte_thread_t * );
+static void* QteMain( vlc_object_t * );
/*****************************************************************************
* Local variables (mutex-protected).
} /* extern "C" */
+static vlc_mutex_t qte_lock = VLC_STATIC_MUTEX;
+
/*****************************************************************************
* Open: initialize and create window
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
- vlc_mutex_t *lock;
-
- lock = var_AcquireMutex( "qte" );
+ vlc_mutex_lock( &qte_lock );
if( i_refcount > 0 )
{
i_refcount++;
- vlc_mutex_unlock( lock );
+ vlc_mutex_unlock( &qte_lock );
return VLC_SUCCESS;
}
}
i_refcount++;
- vlc_mutex_unlock( lock );
+ vlc_mutex_unlock( &qte_lock );
vlc_object_attach( p_qte_main, p_this );
msg_Dbg( p_this, "qte_main running" );
*****************************************************************************/
static void Close( vlc_object_t *p_this )
{
- vlc_mutex_t *lock;
-
- lock = var_AcquireMutex( "qte" );
+ vlc_mutex_lock( &qte_lock );
i_refcount--;
vlc_object_release( p_qte_main );
p_qte_main = NULL;
- vlc_mutex_unlock( lock );
+ vlc_mutex_unlock( &qte_lock );
}
/*****************************************************************************
* this part of the interface is in a separate thread so that we can call
* qte_main() from within it without annoying the rest of the program.
*****************************************************************************/
-static void QteMain( qte_thread_t *p_this )
+static void* QteMain( vlc_object_t* p_vlc_obj )
{
+ qte_thread_t *p_this = (qte_thread_t*)p_vlc_obj;
int i_argc = 1;
+ int canc = vlc_savecancel ();
p_this->b_gui_server = false;
if( config_GetInt( p_this, "qte-guiserver" ) )
vlc_thread_ready( p_this );
p_this->p_qte_application->exec();
+
+ vlc_restorecancel (canc);
+ return NULL;
}