libvlc kills the interfaces when it dies anyway.
VLC_EXPORT( int, intf_RunThread, ( intf_thread_t * ) );
VLC_EXPORT( void, intf_StopThread, ( intf_thread_t * ) );
-/* If the interface is in the main thread, it should listen both to
- * p_intf->b_die and p_libvlc->b_die */
-#define intf_ShouldDie( p_intf ) (p_intf->b_die || p_intf->p_libvlc->b_die )
-
#define intf_Eject(a,b) __intf_Eject(VLC_OBJECT(a),b)
VLC_EXPORT( int, __intf_Eject, ( vlc_object_t *, const char * ) );
msg_Dbg( p_intf, "interface thread initialized" );
/* Main loop */
- while( !intf_ShouldDie( p_intf ) )
+ while( vlc_object_alive( p_intf ) )
{
vlc_mutex_lock( &p_intf->change_lock );
{
char *psz_button;
/* we might need some locking here */
- if( !intf_ShouldDie( p_intf ) )
+ if( vlc_object_alive( p_intf ) )
{
/* p_intf->change_lock locking strategy:
* - Every access to p_intf->p_sys are locked threw p_intf->change_lock
if( code == NULL )
return 0;
- while( !intf_ShouldDie( p_intf )
+ while( vlc_object_alive( p_intf )
&& (lirc_code2char( p_intf->p_sys->config, code, &c ) == 0)
&& (c != NULL) )
{
/* High priority thread */
vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_INPUT );
- while( !intf_ShouldDie( p_intf ) )
+ while( vlc_object_alive( p_intf ) )
{
/* Update the input */
if( p_input == NULL )
}
#endif
- while( !intf_ShouldDie( p_intf ) )
+ while( vlc_object_alive( p_intf ) )
{
char *psz_cmd, *psz_arg;
bool b_complete;
while( WaitForSingleObject( p_intf->p_sys->hConsoleIn,
INTF_IDLE_SLEEP/1000 ) == WAIT_OBJECT_0 )
{
- while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH &&
+ while( vlc_object_alive( p_intf ) && *pi_size < MAX_LINE_LENGTH &&
ReadConsoleInput( p_intf->p_sys->hConsoleIn, &input_record,
1, &i_dw ) )
{
}
#endif
- while( !intf_ShouldDie( p_intf ) && *pi_size < MAX_LINE_LENGTH &&
+ while( vlc_object_alive( p_intf ) && *pi_size < MAX_LINE_LENGTH &&
(i_read = net_Read( p_intf, p_intf->p_sys->i_socket == -1 ?
0 /*STDIN_FILENO*/ : p_intf->p_sys->i_socket, NULL,
(uint8_t *)p_buffer + *pi_size, 1, false ) ) > 0 )
}
/* Main loop */
- while( !intf_ShouldDie( p_intf ) )
+ while( vlc_object_alive( p_intf ) )
{
vlc_mutex_lock( &p_intf->change_lock );
*****************************************************************************/
static int InitThread( intf_thread_t * p_intf )
{
- if( !intf_ShouldDie( p_intf ) )
+ if( vlc_object_alive( p_intf ) )
{
vlc_mutex_lock( &p_intf->change_lock );
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
- while( !intf_ShouldDie( p_intf ) )
+ while( vlc_object_alive( p_intf ) )
{
p_intf->p_sys->p_window->UpdateInterface();
msleep( INTF_IDLE_SLEEP );
intf_sys_t *p_sys = (intf_sys_t*) p_intf->p_sys;
int canc = vlc_savecancel();
- while( !intf_ShouldDie( p_intf ) )
+ while( vlc_object_alive( p_intf ) )
{
int i;
var_AddCallback( p_playlist, "item-append", PlaylistChanged, p_intf );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, p_intf );
- while( !intf_ShouldDie( p_intf ) )
+ while( vlc_object_alive( p_intf ) )
{
msleep( INTF_IDLE_SLEEP );
#ifdef NEED_GTK2_MAIN
msg_Dbg( p_intf, "Manage GTK keyboard events using threads" );
- while( !intf_ShouldDie( p_intf ) )
+ while( vlc_object_alive( p_intf ) )
{
Manage( p_intf );
}
vlc_object_unlock( p_input );
}
- else if( p_intf->p_sys->b_playing && !intf_ShouldDie( p_intf ) )
+ else if( p_intf->p_sys->b_playing && vlc_object_alive( p_intf ) )
{
GtkModeManage( p_intf );
p_intf->p_sys->b_playing = 0;
}
#ifndef NEED_GTK2_MAIN
- if( intf_ShouldDie( p_intf ) )
+ if( !vlc_object_alive( p_intf ) )
{
vlc_mutex_unlock( &p_intf->change_lock );
void MainInterface::updateOnTimer()
{
/* No event for dying */
- if( intf_ShouldDie( p_intf ) )
+ if( !vlc_object_alive( p_intf ) )
{
QApplication::closeAllWindows();
QApplication::quit();
}
}
}
- else if( p_intf->p_sys->b_playing && !intf_ShouldDie( p_intf ) )
+ else if( p_intf->p_sys->b_playing && vlc_object_alive( p_intf ) )
{
p_intf->p_sys->b_playing = 0;
p_main_interface->TogglePlayButton( PAUSE_S );
i_old_playing_status = PAUSE_S;
}
- if( intf_ShouldDie( p_intf ) )
+ if( !vlc_object_alive( p_intf ) )
{
vlc_mutex_unlock( &p_intf->change_lock );
p_intf->p_sys->b_intf_show = false;
}
- if( intf_ShouldDie( p_intf ) )
+ if( !vlc_object_alive( p_intf ) )
{
vlc_mutex_unlock( &p_intf->change_lock );