vlc | branch: master | Francois Cartegnie <[email protected]> | 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, _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
