[vlc-devel] [PATCH 1/2] input: add a new variable storing which ES type was last modified

Felix Abecassis felix.abecassis at gmail.com
Wed Jul 16 13:06:01 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 453e04b..cb1b96f 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,
                     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, 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, 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