* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
- * $Id: input_programs.c,v 1.122 2003/11/24 00:39:02 fenrir Exp $
+ * $Id: input_programs.c,v 1.125 2003/11/29 11:12:46 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
}
if( text2.psz_string ) free( text2.psz_string );
+ free( val.psz_string );
}
if( p_input->stream.i_area_nb == 2 )
switch( p_new_prg->pp_es[i_es_index]->i_cat )
{
case VIDEO_ES:
- msg_Dbg( p_input, "selecting ES %x",
+ msg_Dbg( p_input, "selecting video ES %x",
p_new_prg->pp_es[i_es_index]->i_id );
input_SelectES( p_input, p_new_prg->pp_es[i_es_index] );
break;
i_audio_es += 1;
if( i_audio_es <= i_required_audio_es )
{
- msg_Dbg( p_input, "selecting ES %x",
+ msg_Dbg( p_input, "selecting audio ES %x",
p_new_prg->pp_es[i_es_index]->i_id );
input_SelectES( p_input, p_new_prg->pp_es[i_es_index]);
}
i_spu_es += 1;
if( i_spu_es <= i_required_spu_es )
{
- msg_Dbg( p_input, "selecting ES %x",
+ msg_Dbg( p_input, "selecting spu ES %x",
p_new_prg->pp_es[i_es_index]->i_id );
input_SelectES( p_input, p_new_prg->pp_es[i_es_index] );
}
sprintf( val.psz_string, "title %i", p_area->i_id );
var_Change( p_input, "navigation", VLC_VAR_DELCHOICE, &val, NULL );
var_Destroy( p_input, val.psz_string );
+
+ free( val.psz_string );
}
/* Remove this area from the stream's list of areas */
input_thread_t *p_input = (input_thread_t *)p_this;
unsigned int i;
vlc_value_t val;
+ unsigned int i_cat = UNKNOWN_ES;
+ es_descriptor_t *p_es = NULL;
vlc_mutex_lock( &p_input->stream.stream_lock );
- /* Unselect old ES */
+ /* First search old es type */
for( i = 0 ; i < p_input->stream.i_es_number ; i++ )
{
- if( p_input->stream.pp_es[i]->i_id == oldval.i_int &&
+ if( p_input->stream.pp_es[i]->i_id == oldval.i_int )
+ {
+ i_cat = p_input->stream.pp_es[i]->i_cat;
+ }
+ }
+
+ /* Unselect all old ES */
+ for( i = 0 ; i < p_input->stream.i_es_number ; i++ )
+ {
+ if( p_input->stream.pp_es[i]->i_cat == i_cat &&
+ p_input->stream.pp_es[i]->i_id != newval.i_int &&
p_input->stream.pp_es[i]->p_dec != NULL )
{
input_UnselectES( p_input, p_input->stream.pp_es[i] );
/* Select new ES */
for( i = 0 ; i < p_input->stream.i_es_number ; i++ )
{
- if( p_input->stream.pp_es[i]->i_id == newval.i_int &&
- p_input->stream.pp_es[i]->p_dec == NULL )
+ if( p_input->stream.pp_es[i]->i_id == newval.i_int )
+ {
+ p_es = p_input->stream.pp_es[i];
+ if( p_es->p_dec == NULL )
+ {
+ input_SelectES( p_input, p_es );
+ }
+ }
+ }
+
+ if( p_es )
+ {
+ /* Fix value (mainly for multiple selected ES */
+ val.i_int = p_es->i_id;
+ switch( p_es->i_cat )
{
- input_SelectES( p_input, p_input->stream.pp_es[i] );
+ case AUDIO_ES:
+ var_Change( p_input, "audio-es", VLC_VAR_SETVALUE, &val, NULL );
+ break;
+ case SPU_ES:
+ var_Change( p_input, "spu-es", VLC_VAR_SETVALUE, &val, NULL );
+ break;
+ case VIDEO_ES:
+ var_Change( p_input, "video-es", VLC_VAR_SETVALUE, &val, NULL );
+ break;
}
}