#include "es_out.h"
#include "event.h"
#include "info.h"
+#include "item.h"
#include "../stream_output/stream_output.h"
int i_video;
int i_sub;
- /* es to select */
+ /* es/group to select */
+ int i_group_id;
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 */
p_sys->i_sub = 0;
/* */
+ p_sys->i_group_id = var_GetInteger( p_input, "program" );
+
p_sys->i_audio_last = var_GetInteger( p_input, "audio-track" );
p_sys->i_sub_last = var_GetInteger( p_input, "sub-track" );
/* We do not have a wake up date if the input cannot have its speed
* controlled or sout is imposing its own or while buffering
*
- * FIXME for !p_input->p->b_can_pace_control a wkeup time is still needed to avoid too strong buffering */
+ * FIXME for !p_input->p->b_can_pace_control a wake-up time is still needed
+ * to avoid too heavy buffering */
if( !p_input->p->b_can_pace_control ||
p_input->p->b_out_pace_control ||
p_sys->b_buffering )
{
if( psz_language && *psz_language )
{
- if( asprintf( &text.psz_string, "%s %i - [%s]", _( "Track" ), val.i_int, psz_language ) == -1 )
+ if( asprintf( &text.psz_string, "%s %"PRId64" - [%s]", _( "Track" ), val.i_int, psz_language ) == -1 )
text.psz_string = NULL;
}
else
{
- if( asprintf( &text.psz_string, "%s %i", _( "Track" ), val.i_int ) == -1 )
+ if( asprintf( &text.psz_string, "%s %"PRId64, _( "Track" ), val.i_int ) == -1 )
text.psz_string = NULL;
}
}
EsOutESVarUpdateGeneric( out, es->i_id, &es->fmt, es->psz_language, b_delete );
}
+static bool EsOutIsProgramVisible( es_out_t *out, int i_group )
+{
+ return out->p_sys->i_group_id == 0 || out->p_sys->i_group_id == i_group;
+}
+
/* EsOutProgramSelect:
* Select a program and update the object variable
*/
TAB_APPEND( p_sys->i_pgrm, p_sys->pgrm, p_pgrm );
/* Update "program" variable */
- input_SendEventProgramAdd( p_input, i_group, NULL );
+ if( EsOutIsProgramVisible( out, i_group ) )
+ input_SendEventProgramAdd( p_input, i_group, NULL );
- if( i_group == var_GetInteger( p_input, "program" ) )
+ if( i_group == p_sys->i_group_id || ( !p_sys->p_pgrm && p_sys->i_group_id == 0 ) )
EsOutProgramSelect( out, p_pgrm );
return p_pgrm;
return;
}
/* Find program */
+ if( !EsOutIsProgramVisible( out, i_group ) )
+ return;
p_pgrm = EsOutProgramFind( out, i_group );
if( !p_pgrm )
return;
char *psz_cat;
/* Find program */
+ if( !EsOutIsProgramVisible( out, i_group ) )
+ return;
p_pgrm = EsOutProgramFind( out, i_group );
if( !p_pgrm )
return;
p_block->i_flags |= BLOCK_FLAG_PREROLL;
}
- p_block->i_rate = 0;
-
if( !es->p_dec )
{
block_Release( p_block );
return VLC_SUCCESS;
}
+ case ES_OUT_GET_GROUP_FORCED:
+ {
+ int *pi_group = va_arg( args, int * );
+ *pi_group = p_sys->i_group_id;
+ return VLC_SUCCESS;
+ }
+
case ES_OUT_SET_MODE:
{
const int i_mode = va_arg( args, int );
vlc_object_t **pp_decoder = va_arg( args, vlc_object_t ** );
vout_thread_t **pp_vout = va_arg( args, vout_thread_t ** );
- aout_instance_t **pp_aout = va_arg( args, aout_instance_t ** );
+ audio_output_t **pp_aout = va_arg( args, audio_output_t ** );
if( p_es->p_dec )
{
if( pp_decoder )
{
const iso639_lang_t *pl;
- if( psz_code == NULL )
+ if( psz_code == NULL || !strcmp( psz_code, "und" ) )
{
return strdup( "" );
}
const es_format_t *p_fmt_es = &es->fmt;
lldiv_t div;
+ if( es->fmt.i_cat == fmt->i_cat )
+ {
+ es_format_t update = *fmt;
+ update.i_id = es->i_meta_id;
+ update.i_codec = es->fmt.i_codec;
+ update.i_original_fourcc = es->fmt.i_original_fourcc;
+ input_item_UpdateTracksInfo(input_GetItem(p_input), &update);
+ }
+
/* Create category */
char psz_cat[128];
snprintf( psz_cat, sizeof(psz_cat),_("Stream %d"), es->i_meta_id );
if( !p_cat )
return;
- /* Add informations */
+ /* Add information */
const char *psz_type;
switch( fmt->i_cat )
{
const char *psz_codec_description =
vlc_fourcc_GetDescription( p_fmt_es->i_cat, p_fmt_es->i_codec );
- const vlc_fourcc_t i_codec_fourcc = p_fmt_es->i_original_fourcc ?: p_fmt_es->i_codec;
+ const vlc_fourcc_t i_codec_fourcc = ( p_fmt_es->i_original_fourcc )?
+ p_fmt_es->i_original_fourcc : p_fmt_es->i_codec;
if( psz_codec_description )
info_category_AddInfo( p_cat, _("Codec"), "%s (%.4s)",
psz_codec_description, (char*)&i_codec_fourcc );
info_category_AddInfo( p_cat, _("Frame rate"), "%"PRId64,
div.quot );
}
+ if( fmt->i_codec != p_fmt_es->i_codec )
+ {
+ const char *psz_chroma_description =
+ vlc_fourcc_GetDescription( VIDEO_ES, fmt->i_codec );
+ if( psz_chroma_description )
+ info_category_AddInfo( p_cat, _("Decoded format"), "%s",
+ psz_chroma_description );
+ }
+
break;
case SPU_ES: