From: Laurent Aimar Date: Sun, 13 Jul 2008 15:04:17 +0000 (+0200) Subject: Added input "teletext-es" variable to ease teletext support from X-Git-Tag: 0.9.0-test2~24 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0e3098c5e6e58e2c6861c461a1842f7718771c4d;p=vlc Added input "teletext-es" variable to ease teletext support from interface. (This variable will contain the id of spu-es that is teletext or -1 if not present) --- diff --git a/src/input/es_out.c b/src/input/es_out.c index f25f545daf..24bd6ba06e 100644 --- a/src/input/es_out.c +++ b/src/input/es_out.c @@ -422,6 +422,7 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt, { es_out_sys_t *p_sys = out->p_sys; input_thread_t *p_input = p_sys->p_input; + const bool b_teletext = fmt->i_cat == SPU_ES && fmt->i_codec == VLC_FOURCC( 't', 'e', 'l', 'x' ); vlc_value_t val, text; const char *psz_var; @@ -437,8 +438,12 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt, if( b_delete ) { + if( b_teletext ) + var_SetInteger( p_sys->p_input, "teletext-es", -1 ); + val.i_int = i_id; var_Change( p_input, psz_var, VLC_VAR_DELCHOICE, &val, NULL ); + var_SetBool( p_sys->p_input, "intf-change", true ); return; } @@ -490,6 +495,9 @@ static void EsOutESVarUpdateGeneric( es_out_t *out, int i_id, es_format_t *fmt, free( text.psz_string ); + if( b_teletext ) + var_SetInteger( p_sys->p_input, "teletext-es", i_id ); + var_SetBool( p_sys->p_input, "intf-change", true ); } @@ -550,6 +558,7 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm ) var_Change( p_input, "audio-es", VLC_VAR_CLEARCHOICES, NULL, NULL ); var_Change( p_input, "video-es", VLC_VAR_CLEARCHOICES, NULL, NULL ); var_Change( p_input, "spu-es", VLC_VAR_CLEARCHOICES, NULL, NULL ); + var_SetInteger( p_input, "teletext-es", -1 ); for( i = 0; i < p_sys->i_es; i++ ) { if( p_sys->es[i]->p_pgrm == p_sys->p_pgrm ) diff --git a/src/input/input.c b/src/input/input.c index d23cd4f13b..7ce4c94136 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -112,6 +112,7 @@ static void AppendAttachment( int *pi_attachment, input_attachment_t ***ppp_atta * - seekable (if you can seek, it doesn't say if 'bar display' has be shown * or not, for that check position != 0.0) * - can-pause + * - teletext-es to get the index of spu track that is teletext --1 if no teletext) * * For intf callback upon changes * - intf-change * - rate-change for when playback rate changes diff --git a/src/input/var.c b/src/input/var.c index afdc1c6771..1dbba725eb 100644 --- a/src/input/var.c +++ b/src/input/var.c @@ -462,6 +462,8 @@ void input_ConfigVarInit ( input_thread_t *p_input ) var_Create( p_input, "can-pause", VLC_VAR_BOOL ); val.b_bool = true; /* Fixed later*/ var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL ); + var_Create( p_input, "teletext-es", VLC_VAR_INTEGER ); + var_SetInteger( p_input, "teletext-es", -1 ); /* */ var_Create( p_input, "access-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );