int i, i_devices;
char **devices;
services_discovery_sys_t *p_sys = p_sd->p_sys;
+ int canc = vlc_savecancel();
/* parse existing devices first */
if( ( devices = libhal_get_all_devices( p_sys->p_ctx, &i_devices, NULL ) ) )
libhal_free_string( devices[ i ] );
}
}
+
+ /* FIXME: Totally lame. There are DBus watch functions to do this properly.
+ * -- Courmisch, 28/08/2008 */
while( vlc_object_alive (p_sd) )
{
/* look for events on the bus, blocking 1 second */
dbus_connection_read_write_dispatch( p_sys->p_connection, 1000 );
/* HAL 0.5.8.1 can use libhal_ctx_get_dbus_connection(p_sys->p_ctx) */
}
+ vlc_restorecancel (canc);
}
void DeviceAdded( LibHalContext *p_ctx, const char *psz_udi )
var_Create( p_sd, "podcast-urls", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_AddCallback( p_sd, "podcast-urls", UrlsChange, p_sys );
- while( vlc_object_alive (p_sd) )
+ for( ;; )
{
- int i;
+ /* FIXME: That's 2000 wake up per seconds too many. */
+ msleep( 500 );
+
+ int canc = vlc_savecancel (); /* <- FIXME: should not be needed */
if( p_sys->b_update == true )
{
msg_Dbg( p_sd, "Update required" );
p_sys->b_update = false;
}
- for( i = 0; i < p_sd->p_sys->i_input; i++ )
+ for( int i = 0; i < p_sd->p_sys->i_input; i++ )
{
if( p_sd->p_sys->pp_input[i]->b_eof
|| p_sd->p_sys->pp_input[i]->b_error )
i--;
}
}
- msleep( 500 );
+ vlc_restorecancel (canc);
}
}
{
enum type_e i_type = (enum type_e)p_sd->p_sys;
int i, j;
+ int canc = vlc_savecancel();
if( !p_items[i_type].p_children )
{
vlc_gc_decref( p_input );
}
}
+ vlc_restorecancel(canc);
}
/*****************************************************************************