several coma-separated programs.
{
ES_OUT_MODE_NONE, /* don't select anything */
ES_OUT_MODE_ALL, /* eg for stream output */
{
ES_OUT_MODE_NONE, /* don't select anything */
ES_OUT_MODE_ALL, /* eg for stream output */
- ES_OUT_MODE_AUTO /* best audio/video or for input follow audio-channel, spu-channel */
+ ES_OUT_MODE_AUTO, /* best audio/video or for input follow audio-channel, spu-channel */
+ ES_OUT_MODE_PARTIAL /* select programs given after --programs */
/* all programs */
int i_pgrm;
es_out_pgrm_t **pgrm;
/* all programs */
int i_pgrm;
es_out_pgrm_t **pgrm;
+ es_out_pgrm_t **pp_selected_pgrm; /* --programs */
es_out_pgrm_t *p_pgrm; /* Master program */
/* all es */
es_out_pgrm_t *p_pgrm; /* Master program */
/* all es */
- msg_Err( p_input, "invakud group number" );
+ msg_Err( p_input, "invalid group number" );
if( !es->p_dec )
EsSelect( out, es );
}
if( !es->p_dec )
EsSelect( out, es );
}
+ else if( p_sys->i_mode == ES_OUT_MODE_PARTIAL )
+ {
+ vlc_value_t val;
+ int i;
+ var_Get( p_sys->p_input, "programs", &val );
+ for ( i = 0; i < val.p_list->i_count; i++ )
+ {
+ if ( val.p_list->p_values[i].i_int == es->p_pgrm->i_id || b_force )
+ {
+ if( !es->p_dec )
+ EsSelect( out, es );
+ break;
+ }
+ }
+ var_Change( p_sys->p_input, "programs", VLC_VAR_FREELIST, &val, NULL );
+ }
else if( p_sys->i_mode == ES_OUT_MODE_AUTO )
{
int i_wanted = -1;
else if( p_sys->i_mode == ES_OUT_MODE_AUTO )
{
int i_wanted = -1;
case ES_OUT_SET_MODE:
i = (int) va_arg( args, int );
if( i == ES_OUT_MODE_NONE || i == ES_OUT_MODE_ALL ||
case ES_OUT_SET_MODE:
i = (int) va_arg( args, int );
if( i == ES_OUT_MODE_NONE || i == ES_OUT_MODE_ALL ||
- i == ES_OUT_MODE_AUTO )
+ i == ES_OUT_MODE_AUTO || i == ES_OUT_MODE_PARTIAL )
vlc_value_t val;
double f_fps;
vlc_meta_t *p_meta, *p_meta_user;
vlc_value_t val;
double f_fps;
vlc_meta_t *p_meta, *p_meta_user;
int i, i_delay;
/* Initialize optional stream output. (before access/demuxer) */
int i, i_delay;
/* Initialize optional stream output. (before access/demuxer) */
/* Set up es_out */
es_out_Control( p_input->p_es_out, ES_OUT_SET_ACTIVE, VLC_TRUE );
/* Set up es_out */
es_out_Control( p_input->p_es_out, ES_OUT_SET_ACTIVE, VLC_TRUE );
- val.b_bool = VLC_FALSE;
+ i_es_out_mode = ES_OUT_MODE_AUTO;
+ val.p_list = NULL;
if( p_input->p_sout )
{
var_Get( p_input, "sout-all", &val );
if( p_input->p_sout )
{
var_Get( p_input, "sout-all", &val );
+ if ( val.b_bool )
+ {
+ i_es_out_mode = ES_OUT_MODE_ALL;
+ val.p_list = NULL;
+ }
+ else
+ {
+ var_Get( p_input, "programs", &val );
+ if ( val.p_list && val.p_list->i_count )
+ {
+ i_es_out_mode = ES_OUT_MODE_PARTIAL;
+ /* Note : we should remove the "program" callback. */
+ }
+ else
+ var_Change( p_input, "programs", VLC_VAR_FREELIST, &val, NULL );
+ }
- es_out_Control( p_input->p_es_out, ES_OUT_SET_MODE,
- val.b_bool ? ES_OUT_MODE_ALL : ES_OUT_MODE_AUTO );
+ es_out_Control( p_input->p_es_out, ES_OUT_SET_MODE, i_es_out_mode );
/* Inform the demuxer about waited group (needed only for DVB) */
/* Inform the demuxer about waited group (needed only for DVB) */
- if( val.b_bool )
- demux2_Control( p_input->input.p_demux, DEMUX_SET_GROUP, -1 );
+ if( i_es_out_mode == ES_OUT_MODE_ALL )
+ {
+ demux2_Control( p_input->input.p_demux, DEMUX_SET_GROUP, -1, NULL );
+ }
+ else if( i_es_out_mode == ES_OUT_MODE_PARTIAL )
+ {
+ demux2_Control( p_input->input.p_demux, DEMUX_SET_GROUP, -1,
+ val.p_list );
+ }
demux2_Control( p_input->input.p_demux, DEMUX_SET_GROUP,
demux2_Control( p_input->input.p_demux, DEMUX_SET_GROUP,
- (int) var_GetInteger( p_input, "program" ) );
+ (int) var_GetInteger( p_input, "program" ), NULL );
+ }
es_out_Control( p_input->p_es_out,
ES_OUT_SET_GROUP, val.i_int );
es_out_Control( p_input->p_es_out,
ES_OUT_SET_GROUP, val.i_int );
- demux2_Control( p_input->input.p_demux, DEMUX_SET_GROUP, val.i_int );
+ demux2_Control( p_input->input.p_demux, DEMUX_SET_GROUP, val.i_int,
+ NULL );
break;
case INPUT_CONTROL_SET_ES:
break;
case INPUT_CONTROL_SET_ES:
var_Change( p_input, "program", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "program", ProgramCallback, NULL );
var_Change( p_input, "program", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "program", ProgramCallback, NULL );
+ /* Programs */
+ var_Create( p_input, "programs", VLC_VAR_LIST | VLC_VAR_DOINHERIT );
+ text.psz_string = _("Programs");
+ var_Change( p_input, "programs", VLC_VAR_SETTEXT, &text, NULL );
+
/* Title */
var_Create( p_input, "title", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Title");
/* Title */
var_Create( p_input, "title", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
text.psz_string = _("Title");
#define INPUT_PROGRAM_LONGTEXT N_( \
"Choose the program to select by giving its Service ID.")
#define INPUT_PROGRAM_LONGTEXT N_( \
"Choose the program to select by giving its Service ID.")
+#define INPUT_PROGRAMS_TEXT N_("Choose programs")
+#define INPUT_PROGRAMS_LONGTEXT N_( \
+ "Choose the programs to select by giving a comma-separated list of" \
+ "SIDs.")
+
#define INPUT_AUDIO_TEXT N_("Choose audio")
#define INPUT_AUDIO_LONGTEXT N_( \
"Give the default type of audio you want to use in a DVD. " \
#define INPUT_AUDIO_TEXT N_("Choose audio")
#define INPUT_AUDIO_LONGTEXT N_( \
"Give the default type of audio you want to use in a DVD. " \
add_integer( "program", 0, NULL,
INPUT_PROGRAM_TEXT, INPUT_PROGRAM_LONGTEXT, VLC_TRUE );
add_integer( "program", 0, NULL,
INPUT_PROGRAM_TEXT, INPUT_PROGRAM_LONGTEXT, VLC_TRUE );
+ add_string( "programs", "", NULL,
+ INPUT_PROGRAMS_TEXT, INPUT_PROGRAMS_LONGTEXT, VLC_FALSE );
add_integer( "audio-type", -1, NULL,
INPUT_AUDIO_TEXT, INPUT_AUDIO_LONGTEXT, VLC_TRUE );
add_integer( "audio-channel", -1, NULL,
add_integer( "audio-type", -1, NULL,
INPUT_AUDIO_TEXT, INPUT_AUDIO_LONGTEXT, VLC_TRUE );
add_integer( "audio-channel", -1, NULL,