[vlc-commits] input: event: don't set non-existing list variable

Francois Cartegnie git at videolan.org
Thu Nov 24 19:34:23 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct 18 15:14:30 2016 +0200| [c628e724b290303f98714f5ee382782a06307985] | committer: Francois Cartegnie

input: event: don't set non-existing list variable

This reverts commit 7ddd2f341f6bd54282061fa44d5c96d2dc560256.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c628e724b290303f98714f5ee382782a06307985
---

 src/input/event.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/input/event.c b/src/input/event.c
index e949a19..9f6fb0c 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -264,29 +264,30 @@ static const char *GetEsVarName( int i_cat )
         return "video-es";
     case AUDIO_ES:
         return "audio-es";
-    case NAV_ES:
-        return "nav-es";
-    default:
-        assert( i_cat == SPU_ES );
+    case SPU_ES:
         return "spu-es";
+    default:
+        return NULL;
     }
 }
 void input_SendEventEsAdd( input_thread_t *p_input, int i_cat, int i_id, const char *psz_text )
 {
-    if( i_cat != UNKNOWN_ES )
-        VarListAdd( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES,
-                    i_id, psz_text );
+    const char *psz_varname = GetEsVarName( i_cat );
+    if( psz_varname )
+        VarListAdd( p_input, psz_varname, 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 )
-        VarListDel( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES, i_id );
+    const char *psz_varname = GetEsVarName( i_cat );
+    if( psz_varname )
+        VarListDel( p_input, psz_varname, 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 )
-        VarListSelect( p_input, GetEsVarName( i_cat ), INPUT_EVENT_ES, i_id );
+    const char *psz_varname = GetEsVarName( i_cat );
+    if( psz_varname )
+        VarListSelect( p_input, psz_varname, INPUT_EVENT_ES, i_id );
 }
 
 void input_SendEventTeletextAdd( input_thread_t *p_input,



More information about the vlc-commits mailing list