+ vlc_object_release( p_playlist );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * VLC_Stop: stop
+ *****************************************************************************/
+int VLC_Stop( int i_object )
+{
+ intf_thread_t * p_intf;
+ playlist_t * p_playlist;
+ vout_thread_t * p_vout;
+ aout_instance_t * p_aout;
+ vlc_t *p_vlc;
+
+ p_vlc = i_object ? vlc_object_get( &libvlc, i_object ) : p_static_vlc;
+
+ /* Check that the handle is valid */
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ /*
+ * Ask the interfaces to stop and destroy them
+ */
+ msg_Dbg( p_vlc, "removing all interfaces" );
+ while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF, FIND_CHILD )) )
+ {
+ intf_StopThread( p_intf );
+ vlc_object_detach( p_intf );
+ vlc_object_release( p_intf );
+ intf_Destroy( p_intf );
+ }
+
+ /*
+ * Free playlists
+ */
+ msg_Dbg( p_vlc, "removing all playlists" );
+ while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
+ FIND_CHILD )) )
+ {
+ vlc_object_detach( p_playlist );
+ vlc_object_release( p_playlist );
+ playlist_Destroy( p_playlist );
+ }
+
+ /*
+ * Free video outputs
+ */
+ msg_Dbg( p_vlc, "removing all video outputs" );
+ while( (p_vout = vlc_object_find( p_vlc, VLC_OBJECT_VOUT, FIND_CHILD )) )
+ {
+ vlc_object_detach( p_vout );
+ vlc_object_release( p_vout );
+ vout_Destroy( p_vout );
+ }
+
+ /*
+ * Free audio outputs
+ */
+ msg_Dbg( p_vlc, "removing all audio outputs" );
+ while( (p_aout = vlc_object_find( p_vlc, VLC_OBJECT_AOUT, FIND_CHILD )) )
+ {
+ vlc_object_detach( (vlc_object_t *)p_aout );
+ vlc_object_release( (vlc_object_t *)p_aout );
+ aout_Delete( p_aout );
+ }
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * VLC_Pause: toggle pause
+ *****************************************************************************/
+int VLC_Pause( int i_object )
+{
+ input_thread_t *p_input;
+ vlc_t *p_vlc;
+
+ p_vlc = i_object ? vlc_object_get( &libvlc, i_object ) : p_static_vlc;
+
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_input = vlc_object_find( p_vlc, VLC_OBJECT_INPUT, FIND_CHILD );
+
+ if( !p_input )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ input_SetStatus( p_input, INPUT_STATUS_PAUSE );
+ vlc_object_release( p_input );
+
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * VLC_FullScreen: toggle fullscreen mode
+ *****************************************************************************/
+int VLC_FullScreen( int i_object )
+{
+ vout_thread_t *p_vout;
+ vlc_t *p_vlc;
+
+ p_vlc = i_object ? vlc_object_get( &libvlc, i_object ) : p_static_vlc;
+
+ if( !p_vlc )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ p_vout = vlc_object_find( p_vlc, VLC_OBJECT_VOUT, FIND_CHILD );
+
+ if( !p_vout )
+ {
+ if( i_object ) vlc_object_release( p_vlc );
+ return VLC_ENOOBJ;
+ }
+
+ p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+ vlc_object_release( p_vout );
+
+ if( i_object ) vlc_object_release( p_vlc );