- input_thread_t *p_input;
-
- /* Check playing state every 30 seconds */
- if( vlc_object_timedwait( p_intf, mdate() + 30000000 ) < 0 )
- break;
-
- p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
- if( p_input )
- {
- if( PLAYING_S == p_input->i_state && !p_intf->p_sys->i_cookie )
- {
- if( !Inhibit( p_intf ) )
- {
- vlc_object_release( p_input );
- goto end;
- }
- }
- else if( p_intf->p_sys->i_cookie )
- {
- if( !UnInhibit( p_intf ) )
- {
- vlc_object_release( p_input );
- goto end;
- }
- }
- vlc_object_release( p_input );
- }
- else if( p_intf->p_sys->i_cookie )
- {
- if( !UnInhibit( p_intf ) )
- goto end;
- }
+ var_DelCallback( p_sys->p_input, "state", StateChange, p_intf );
+ vlc_object_release( p_sys->p_input );