the 10_ADD keypresses */
int number_addend = 0;
+ int canc = vlc_savecancel();
if( InitThread( p_intf ) < 0 )
{
msg_Err( p_intf, "can't initialize intf" );
p_vcdplayer = p_intf->p_sys->p_vcdplayer;
p_access = p_vcdplayer->p_access;
+ int canc = vlc_savecancel();
dbg_print( INPUT_DBG_CALL, "intf initialized" );
/* Main loop */
}
vlc_object_release( p_intf->p_sys->p_input );
+ vlc_restorecancel( canc );
}
/*****************************************************************************
*****************************************************************************/
static void RunIntf( intf_thread_t *p_intf )
{
+ int canc = vlc_savecancel();
vout_thread_t * p_vout = NULL;
if( InitThread( p_intf ) < 0 )
}
vlc_object_release( p_intf->p_sys->p_input );
+ vlc_restorecancel( canc );
}
/*****************************************************************************
static void Run ( intf_thread_t *p_intf )
{
- while( !intf_ShouldDie( p_intf ) )
+ for( ;; )
{
msleep( INTF_IDLE_SLEEP );
+ int canc = vlc_savecancel();
dbus_connection_read_write_dispatch( p_intf->p_sys->p_conn, 0 );
+ vlc_restorecancel( canc );
}
}
static void RunIntf( intf_thread_t *p_intf )
{
playlist_t * p_playlist = NULL;
+ int canc = vlc_savecancel();
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->p_vout = NULL;
}
EndThread( p_intf );
+ vlc_restorecancel( canc );
}
/*****************************************************************************
vlc_value_t val;
int i;
playlist_t *p_playlist = pl_Yield( p_intf );
+ int canc = vlc_savecancel();
/* Initialize hotkey structure */
for( struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
vlc_object_release( p_input );
}
pl_Release( p_intf );
+ vlc_restorecancel( canc );
}
static int GetAction( intf_thread_t *p_intf )
static void Run( intf_thread_t *p_intf )
{
char *code, *c;
+ int canc = vlc_savecancel();
- while( !intf_ShouldDie( p_intf ) )
+ for( ;; )
{
/* Sleep a bit */
+ vlc_restorecancel(canc);
msleep( INTF_IDLE_SLEEP );
+ canc = vlc_savecancel();
/* We poll the lircsocket */
if( lirc_nextcode(&code) != 0 )
}
free( code );
}
+ vlc_restorecancel(canc);
}
int p_oldx[FILTER_LENGTH];
memset( p_oldx, 0, FILTER_LENGTH * sizeof( int ) );
- while( !intf_ShouldDie( p_intf ) )
+ for( ;; )
{
vout_thread_t *p_vout;
const char *psz_filter, *psz_type;
/* Wait a bit, get orientation, change filter if necessary */
msleep( INTF_IDLE_SLEEP );
+ int canc = vlc_savecancel();
i_x = GetOrientation( p_intf );
i_sum += i_x - p_oldx[i];
p_oldx[i++] = i_x;
vlc_object_release( p_obj );
}
}
- continue;
+ goto loop;
}
if( i_x < -HIGH_THRESHOLD && i_oldx > -LOW_THRESHOLD )
psz_type = "90";
}
- if( !b_change )
+ if( b_change )
{
- continue;
- }
+ p_vout = (vout_thread_t *)
+ vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
+ if( p_vout )
+ {
+ config_PutPsz( p_vout, "transform-type", psz_type );
+ var_SetString( p_vout, "vout-filter", psz_filter );
+ vlc_object_release( p_vout );
- p_vout = (vout_thread_t *)
- vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
- if( !p_vout )
- {
- continue;
+ i_oldx = i_x;
+ }
}
-
- config_PutPsz( p_vout, "transform-type", psz_type );
- var_SetString( p_vout, "vout-filter", psz_filter );
- vlc_object_release( p_vout );
-
- i_oldx = i_x;
+loop:
+ vlc_restorecancel( canc );
}
}
#undef FILTER_LENGTH
char *psz_master = NULL;
char p_data[MAX_MSG_LENGTH];
int i_socket;
+ int canc = vlc_savecancel();
if( !b_master )
{
if( p_intf->p_sys->p_input ) vlc_object_release( p_intf->p_sys->p_input );
net_Close( i_socket );
+ vlc_restorecancel( canc );
}
static mtime_t GetClockRef( intf_thread_t *p_intf, mtime_t i_pts )
{ NULL, NULL }
};
+ int canc = vlc_savecancel();
p_global_intf = p_intf;
p_intf->p_sys = &sys;
p_intf->p_sys->psz_service = config_GetPsz( p_intf, "ntservice-name" );
/* Make sure we exit (In case other interfaces have been spawned) */
vlc_object_kill( p_intf->p_libvlc );
+ vlc_restorecancel( canc );
}
/*****************************************************************************
input_thread_t * p_input;
playlist_t * p_playlist;
- char p_buffer[ MAX_LINE_LENGTH + 1 ];
+ char p_buffer[ MAX_LINE_LENGTH + 1 ];
bool b_showpos = config_GetInt( p_intf, "rc-show-pos" );
bool b_longhelp = false;
- int i_size = 0;
- int i_oldpos = 0;
- int i_newpos;
+ int i_size = 0;
+ int i_oldpos = 0;
+ int i_newpos;
+ int canc = vlc_savecancel();
p_buffer[0] = 0;
p_input = NULL;
}
var_DelCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, p_intf );
+ vlc_restorecancel( canc );
}
static void Help( intf_thread_t *p_intf, bool b_longhelp)
*****************************************************************************/
static void RunIntf( intf_thread_t *p_intf )
{
+ int canc = vlc_savecancel( );
p_intf->p_sys->p_vout = NULL;
if( InitThread( p_intf ) < 0 )
MouseEvent, p_intf );
vlc_object_release( p_intf->p_sys->p_vout );
}
+ vlc_restorecancel( canc );
}
/*****************************************************************************
static void Run( intf_thread_t *p_intf )
{
intf_sys_t *p_sys = (intf_sys_t*) p_intf->p_sys;
+ int canc = vlc_savecancel();
while( !intf_ShouldDie( p_intf ) )
{
}
End( p_intf );
+ vlc_restorecancel( canc );
}
static int OverlayCallback( vlc_object_t *p_this, char const *psz_cmd,
int i_key;
time_t t_last_refresh;
+ int canc = vlc_savecancel();
/*
* force drawing the interface for the first time
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, p_intf );
var_DelCallback( p_playlist, "item-append", PlaylistChanged, p_intf );
var_DelCallback( p_playlist, "item-change", PlaylistChanged, p_intf );
+ vlc_restorecancel( canc );
}
/* following functions are local */
GtkTreeViewColumn *p_column = NULL;
GtkListStore *p_filelist = NULL;
GtkListStore *p_playlist_store = NULL;
+ int canc = vlc_savecancel();
#ifndef NEED_GTK2_MAIN
gtk_set_locale ();
#ifdef NEED_GTK2_MAIN
gdk_threads_leave();
#endif
+ vlc_restorecancel(canc);
}
/*****************************************************************************
msg_Err( p_intf, "failed to create Qt dialogs thread" );
}
else
+ {
+ int canc = vlc_savecancel ();
Init( VLC_OBJECT(p_intf) );
+ vlc_restorecancel( canc );
+ }
}
static QMutex windowLock;
//---------------------------------------------------------------------------
static void Run( intf_thread_t *p_intf )
{
+ int canc = vlc_savecancel();
// Load a theme
ThemeLoader *pLoader = new ThemeLoader( p_intf );
char *skin_last = config_GetPsz( p_intf, "skins2-last" );
delete p_intf->p_sys->p_theme;
p_intf->p_sys->p_theme = NULL;
}
+ vlc_restorecancel(canc);
}
}
else
{
+ int canc = vlc_savecancel();
/* The module is used in interface mode */
MainLoop( p_intf );
+ vlc_restorecancel( canc );
}
}
}
else
{
+ int canc = vlc_savecancel();
/* The module is used in interface mode */
Init( p_intf );
+ vlc_restorecancel( canc );
}
}
uint8_t p_buffer[1024];
char *p_buffer_pos;
int i_post_socket;
+ int canc = vlc_savecancel();
intf_sys_t *p_sys = p_intf->p_sys;
{
bool b_wait = false;
+ vlc_restorecancel( canc );
vlc_object_lock( p_intf );
- if( !vlc_object_alive( p_intf ) )
- {
- vlc_object_unlock( p_intf );
- msg_Dbg( p_intf, "audioscrobbler is dying");
- return;
- }
+ vlc_cleanup_push( __vlc_object_unlock, p_intf );
+
if( mdate() < p_sys->next_exchange )
/* wait until we can resubmit, i.e. */
b_wait = vlc_object_timedwait( p_intf, p_sys->next_exchange ) == 0;
/* wait for data to submit */
/* we are signaled each time there is a song to submit */
vlc_object_wait( p_intf );
- vlc_object_unlock( p_intf );
+ vlc_cleanup_run();
+ canc = vlc_savecancel();
if( b_wait )
continue; /* holding on until next_exchange */
continue;
}
}
+ vlc_restorecancel( canc );
}
/*****************************************************************************
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
- vlc_object_lock( p_intf );
- while( vlc_object_alive( p_intf ) )
+ for( ;; )
{
input_thread_t *p_input;
/* Check playing state every 30 seconds */
- vlc_object_timedwait( p_intf, mdate() + 30000000 );
+ msleep( 30 * CLOCK_FREQ );
p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
if( p_input )
break;
}
}
-
-end:
- vlc_object_unlock( p_intf );
}
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
- while( vlc_object_alive (p_intf) )
+ for( ;; )
{
+ int canc = vlc_savecancel();
FlushQueue( p_intf->p_sys->p_sub, p_intf->p_sys->p_file,
p_intf->p_sys->i_mode,
var_CreateGetInteger( p_intf, "verbose" ) );
if( p_intf->p_sys->p_rrd )
DoRRD( p_intf );
+ vlc_restorecancel( canc );
+ /* FIXME: this is WRONG. */
msleep( INTF_IDLE_SLEEP );
}
}
static void Run( intf_thread_t *p_intf )
{
+ int canc = vlc_savecancel( );
lua_State *L = p_intf->p_sys->L;
if( luaL_dofile( L, p_intf->p_sys->psz_filename ) )
p_intf->p_sys->psz_filename,
lua_tostring( L, lua_gettop( L ) ) );
lua_pop( L, 1 );
- p_intf->b_die = true;
- return;
}
- p_intf->b_die = true;
+ vlc_restorecancel( canc );
}
char psz_duration[MSTRTIME_MAX_SIZE+2];
char *psz_display = NULL;
- while( vlc_object_alive (p_intf) )
+ for( ;; )
{
+ int canc = vlc_savecancel();
if( p_intf->p_sys->b_need_update == true )
{
p_intf->p_sys->b_need_update = false;
psz_display );
}
+ vlc_restorecancel( canc );
msleep( INTF_IDLE_SLEEP );
}
}
int i, i_devices, j;
char **devices;
bool b_exists;
+ int canc = vlc_savecancel();
for ( j = 0 ; j < p_sys->i_devices; j++ )
p_sys->pp_devices[j]->b_seen = false;
}
}
/// \todo Remove unseen devices
+ vlc_restorecancel( canc );
}
*****************************************************************************/
static void Run( intf_thread_t *p_intf )
{
- mtime_t deadline = mdate();
-
- vlc_object_lock( p_intf );
+ int canc = vlc_savecancel();
#ifdef HAVE_DBUS
p_intf->p_sys->p_connection = dbus_init( p_intf );
#endif
- while( vlc_object_alive( p_intf ) )
- {
+ for( ;; )
+ {
vlc_object_t *p_vout;
- if( vlc_object_timedwait( p_intf, deadline ) == 0 )
- continue;
-
p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
/* If there is a video output, disable xscreensaver */
}
}
+ vlc_restorecancel( canc );
/* Check screensaver every 30 seconds */
- deadline = mdate() + 30000000;
+ msleep( 30 * CLOCK_FREQ );
}
- vlc_object_unlock( p_intf );
}
#ifdef HAVE_DBUS