Commit 522baa53 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Cleanup handling of thread-less interfaces

parent e3fa003b
......@@ -150,10 +150,6 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module,
*/
int intf_RunThread( intf_thread_t *p_intf )
{
/* This interface doesn't need to be run */
if( p_intf->pf_run == NULL )
return VLC_SUCCESS;
/* Hack to get Mac OS X Cocoa runtime running
* (it needs access to the main thread) */
if( p_intf->b_should_run_on_first_thread )
......@@ -186,11 +182,8 @@ void intf_StopThread( intf_thread_t *p_intf )
{
/* Tell the interface to die */
vlc_object_kill( p_intf );
if( p_intf->pf_run != NULL )
{
vlc_cond_signal( &p_intf->object_wait );
vlc_thread_join( p_intf );
}
}
/* Following functions are local */
......@@ -229,7 +222,10 @@ static void RunInterface( intf_thread_t *p_intf )
do
{
/* Give control to the interface */
if( p_intf->pf_run )
p_intf->pf_run( p_intf );
else
while( vlc_object_lock_and_wait( p_intf ) == 0 );
/* Reset play on start status */
p_intf->b_play = false;
......
......@@ -1150,12 +1150,7 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc,
if( b_block )
{
/* FIXME: should be moved to interface/interface.c */
if( p_intf->pf_run )
vlc_thread_join( p_intf );
else
while( vlc_object_lock_and_wait( p_intf ) == 0 );
vlc_object_detach( p_intf );
vlc_object_release( p_intf );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment