- /* Check playing state every 30 seconds */
- msleep( 30 * CLOCK_FREQ );
-
- p_input = playlist_CurrentInput( p_playlist );
- if( p_input )
- {
- const int i_state = var_GetInteger( p_input, "state" );
- vlc_object_release( p_input );
-
- if( PLAYING_S == i_state )
- {
- if( !p_intf->p_sys->i_cookie )
- {
- if( !Inhibit( p_intf ) )
- break;
- }
- }
- else if( p_intf->p_sys->i_cookie )
- {
- if( !UnInhibit( p_intf ) )
- break;
- }
- }
- else if( p_intf->p_sys->i_cookie )
- {
- if( !UnInhibit( p_intf ) )
- break;
- }
+ var_DelCallback( p_sys->p_input, "state", StateChange, p_intf );
+ vlc_object_release( p_sys->p_input );