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,16 +256,20 @@ void input_ControlVarNavigation( input_thread_t *p_input ) ...@@ -256,16 +256,20 @@ 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 )
{ {
if( var_Type( p_input, "next-title" ) == 0 ) {
var_Create( p_input, "next-title", VLC_VAR_VOID ); var_Create( p_input, "next-title", VLC_VAR_VOID );
text.psz_string = _("Next title"); text.psz_string = _("Next title");
var_Change( p_input, "next-title", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_input, "next-title", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "next-title", TitleCallback, NULL ); var_AddCallback( p_input, "next-title", TitleCallback, NULL );
}
if( var_Type( p_input, "prev-title" ) == 0 ) {
var_Create( p_input, "prev-title", VLC_VAR_VOID ); var_Create( p_input, "prev-title", VLC_VAR_VOID );
text.psz_string = _("Previous title"); text.psz_string = _("Previous title");
var_Change( p_input, "prev-title", VLC_VAR_SETTEXT, &text, NULL ); var_Change( p_input, "prev-title", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "prev-title", TitleCallback, NULL ); var_AddCallback( p_input, "prev-title", TitleCallback, NULL );
} }
}
/* Create titles and chapters */ /* Create titles and chapters */
var_Change( p_input, "title", VLC_VAR_CLEARCHOICES, NULL, NULL ); var_Change( p_input, "title", VLC_VAR_CLEARCHOICES, NULL, NULL );
......
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