Commit 460b1fca authored by Eric Petit's avatar Eric Petit
Browse files

+ src/input/var.c: when starting a title, don't recreate next/prev-chapter

     and add callbacks if they already exist
parent 381fcdb7
......@@ -333,7 +333,12 @@ void input_ControlVarTitle( input_thread_t *p_input, int i_title )
int i;
/* Create/Destroy command variables */
if( t->i_seekpoint > 1 )
if( t->i_seekpoint <= 1 )
{
var_Destroy( p_input, "next-chapter" );
var_Destroy( p_input, "prev-chapter" );
}
else if( var_Get( p_input, "next-chapter", &val ) != VLC_SUCCESS )
{
vlc_value_t text;
......@@ -347,11 +352,6 @@ void input_ControlVarTitle( input_thread_t *p_input, int i_title )
var_Change( p_input, "prev-chapter", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_input, "prev-chapter", SeekpointCallback, NULL );
}
else
{
var_Destroy( p_input, "next-chapter" );
var_Destroy( p_input, "prev-chapter" );
}
/* Build chapter list */
var_Change( p_input, "chapter", 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