Commit e2115fed authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Jean-Baptiste Kempf

input: register title change callbacks only once

Fixes skipping multiple titles with single click.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 2d7a0207
...@@ -256,15 +256,19 @@ void input_ControlVarNavigation( input_thread_t *p_input ) ...@@ -256,15 +256,19 @@ void input_ControlVarNavigation( input_thread_t *p_input )
/* Create more command variables */ /* Create more command variables */
if( p_input->p->i_title > 1 ) if( p_input->p->i_title > 1 )
{ {
var_Create( p_input, "next-title", VLC_VAR_VOID ); if( var_Type( p_input, "next-title" ) == 0 ) {
text.psz_string = _("Next title"); var_Create( p_input, "next-title", VLC_VAR_VOID );
var_Change( p_input, "next-title", VLC_VAR_SETTEXT, &text, NULL ); text.psz_string = _("Next title");
var_AddCallback( p_input, "next-title", TitleCallback, NULL ); var_Change( p_input, "next-title", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "next-title", TitleCallback, NULL );
var_Create( p_input, "prev-title", VLC_VAR_VOID ); }
text.psz_string = _("Previous title");
var_Change( p_input, "prev-title", VLC_VAR_SETTEXT, &text, NULL ); if( var_Type( p_input, "prev-title" ) == 0 ) {
var_AddCallback( p_input, "prev-title", TitleCallback, NULL ); var_Create( p_input, "prev-title", VLC_VAR_VOID );
text.psz_string = _("Previous title");
var_Change( p_input, "prev-title", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "prev-title", TitleCallback, NULL );
}
} }
/* Create titles and chapters */ /* Create titles and chapters */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment