/* set es selected for the es category(audio/video/spu) */
ES_OUT_SET_ES, /* arg1= es_out_id_t* */
+ /* set 'default' tag on es (copied across from container) */
+ ES_OUT_SET_DEFAULT, /* arg1= es_out_id_t* */
+
/* force selection/unselection of the ES (bypass current mode)*/
ES_OUT_SET_ES_STATE,/* arg1= es_out_id_t* arg2=vlc_bool_t */
ES_OUT_GET_ES_STATE,/* arg1= es_out_id_t* arg2=vlc_bool_t* */
tracks[i_track]->p_es = es_out_Add( sys.demuxer.out, &tracks[i_track]->fmt );
+ /* Turn on a subtitles track if it has been flagged as default -
+ * but only do this if no subtitles track has already been engaged,
+ * either by an earlier 'default track' (??) or by default
+ * language choice behaviour.
+ */
+ if( tracks[i_track]->b_default )
+ {
+ es_out_Control( sys.demuxer.out,
+ ES_OUT_SET_DEFAULT,
+ tracks[i_track]->p_es );
+ }
+
es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, tracks[i_track]->p_es, i_start_time );
}
/* es to select */
int i_audio_last, i_audio_id;
int i_sub_last, i_sub_id;
+ int i_default_sub_id; /* As specified in container; if applicable */
char **ppsz_audio_language;
char **ppsz_sub_language;
var_Get( p_input, "sub-track", &val );
p_sys->i_sub_last = val.i_int;
+ p_sys->i_default_sub_id = -1;
+
if( !p_input->b_preparsing )
{
var_Get( p_input, "audio-language", &val );
i_wanted = es->i_channel;
}
+ else if( p_sys->i_default_sub_id >= 0 )
+ {
+ if( es->i_id == p_sys->i_default_sub_id )
+ i_wanted = es->i_channel;
+ }
+
if( p_sys->i_sub_last >= 0 )
i_wanted = p_sys->i_sub_last;
pl_Release( p_playlist );
}
return VLC_SUCCESS;
+
+ case ES_OUT_SET_DEFAULT:
+ {
+ es = (es_out_id_t*) va_arg( args, es_out_id_t * );
+
+ if( es == NULL )
+ {
+ /*p_sys->i_default_video_id = -1;*/
+ /*p_sys->i_default_audio_id = -1;*/
+ p_sys->i_default_sub_id = -1;
+ }
+ else if( es == (es_out_id_t*)((uint8_t*)NULL+AUDIO_ES) )
+ {
+ /*p_sys->i_default_video_id = -1;*/
+ }
+ else if( es == (es_out_id_t*)((uint8_t*)NULL+VIDEO_ES) )
+ {
+ /*p_sys->i_default_audio_id = -1;*/
+ }
+ else if( es == (es_out_id_t*)((uint8_t*)NULL+SPU_ES) )
+ {
+ p_sys->i_default_sub_id = -1;
+ }
+ else
+ {
+ /*if( es->fmt.i_cat == VIDEO_ES )
+ p_sys->i_default_video_id = es->i_id;
+ else
+ if( es->fmt.i_cat == AUDIO_ES )
+ p_sys->i_default_audio_id = es->i_id;
+ else*/
+ if( es->fmt.i_cat == SPU_ES )
+ p_sys->i_default_sub_id = es->i_id;
+ }
+ return VLC_SUCCESS;
+ }
case ES_OUT_SET_PCR:
case ES_OUT_SET_GROUP_PCR: