/*****************************************************************************
* control.c
*****************************************************************************
- * Copyright (C) 1999-2004 VideoLAN
+ * Copyright (C) 1999-2004 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <stdlib.h>
}
return VLC_SUCCESS;
+ case INPUT_DEL_INFO:
+ {
+ char *psz_cat = (char *)va_arg( args, char * );
+ char *psz_name = (char *)va_arg( args, char * );
+
+ info_category_t *p_cat = NULL;
+ int i;
+
+ vlc_mutex_lock( &p_input->input.p_item->lock );
+ for( i = 0; i < p_input->input.p_item->i_categories; i++ )
+ {
+ if( !strcmp( p_input->input.p_item->pp_categories[i]->psz_name,
+ psz_cat ) )
+ {
+ p_cat = p_input->input.p_item->pp_categories[i];
+ break;
+ }
+ }
+ if( p_cat == NULL )
+ {
+ vlc_mutex_unlock( &p_input->input.p_item->lock );
+ return VLC_EGENERIC;
+ }
+
+ for( i = 0; i < p_cat->i_infos; i++ )
+ {
+ if( !strcmp( p_cat->pp_infos[i]->psz_name, psz_name ) )
+ {
+ free( p_cat->pp_infos[i]->psz_name );
+ if( p_cat->pp_infos[i]->psz_value )
+ free( p_cat->pp_infos[i]->psz_value );
+ free( p_cat->pp_infos[i] );
+ REMOVE_ELEM( p_cat->pp_infos, p_cat->i_infos, i );
+ break;
+ }
+ }
+ vlc_mutex_unlock( &p_input->input.p_item->lock );
+
+ if( i >= p_cat->i_infos )
+ return VLC_EGENERIC;
+
+ NotifyPlaylist( p_input );
+ }
+ return VLC_SUCCESS;
+
+
case INPUT_GET_INFO:
{
char *psz_cat = (char *)va_arg( args, char * );
char *psz_name = (char *)va_arg( args, char * );
char **ppsz_value = (char **)va_arg( args, char ** );
int i_ret = VLC_EGENERIC;
- int i;
*ppsz_value = NULL;
*ppsz_value = vlc_input_item_GetInfo( p_input->input.p_item,
FIND_PARENT );
if( p_playlist )
{
- var_SetInteger( p_playlist, "item-change", p_playlist->i_index );
+ var_SetInteger( p_playlist, "item-change",
+ p_input->input.p_item->i_id );
vlc_object_release( p_playlist );
}
}