[vlc-devel] [PATCH 2/4] input: add a new variable storing which ES type was last modified
Felix Abecassis
felix.abecassis at gmail.com
Fri Jul 18 19:40:50 CEST 2014
---
src/input/event.c | 9 +++++++++
src/input/var.c | 2 ++
2 files changed, 11 insertions(+)
diff --git a/src/input/event.c b/src/input/event.c
index a467235..34148c6 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -278,19 +278,28 @@ static const char *GetEsVarName( int i_cat )
void input_SendEventEsAdd( input_thread_t *p_input, int i_cat, int i_id, const char *psz_text )
{
if( i_cat != UNKNOWN_ES )
+ {
+ var_SetInteger( p_input, "es-type", i_cat );
VarListAdd( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES_ADD,
i_id, psz_text );
+ }
}
void input_SendEventEsDel( input_thread_t *p_input, int i_cat, int i_id )
{
if( i_cat != UNKNOWN_ES )
+ {
+ var_SetInteger( p_input, "es-type", i_cat );
VarListDel( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES_DELETE, i_id );
+ }
}
/* i_id == -1 will unselect */
void input_SendEventEsSelect( input_thread_t *p_input, int i_cat, int i_id )
{
if( i_cat != UNKNOWN_ES )
+ {
+ var_SetInteger( p_input, "es-type", i_cat );
VarListSelect( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES_SELECT, i_id );
+ }
}
void input_SendEventTeletextAdd( input_thread_t *p_input,
diff --git a/src/input/var.c b/src/input/var.c
index 7591de4..8cea426 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -228,6 +228,8 @@ void input_ControlVarInit ( input_thread_t *p_input )
{
/* Special "intf-event" variable. */
var_Create( p_input, "intf-event", VLC_VAR_INTEGER );
+ /* Which ES type was last modified (addition/removal/selection of a track). */
+ var_Create( p_input, "es-type", VLC_VAR_INTEGER );
}
/* Add all callbacks
--
1.9.1
More information about the vlc-devel
mailing list