Commit aa41414d authored by Gildas Bazin's avatar Gildas Bazin

* src/input/control.c: fixed INPUT_DEL_BOOKMARK.

parent 0880ea2e
......@@ -85,45 +85,27 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
break;
case INPUT_DEL_BOOKMARK:
p_bkmk = (seekpoint_t *)va_arg( args, seekpoint_t * );
if( p_input->i_bookmarks )
i_bkmk = (int)va_arg( args, int );
if( i_bkmk < p_input->i_bookmarks )
{
int i;
p_bkmk = p_input->pp_bookmarks[i_bkmk];
TAB_REMOVE( p_input->i_bookmarks, p_input->pp_bookmarks,
p_bkmk );
vlc_seekpoint_Delete( p_bkmk );
/* Reflect the changes on the object var */
var_Change( p_input, "bookmark", VLC_VAR_CLEARCHOICES, 0, 0 );
for( i = 0; i < p_input->i_bookmarks; i++ )
{
if( ( p_bkmk->i_byte_offset &&
p_input->pp_bookmarks[i]->i_byte_offset ==
p_bkmk->i_byte_offset ) ||
( p_bkmk->i_time_offset &&
p_input->pp_bookmarks[i]->i_time_offset ==
p_bkmk->i_time_offset ) ||
( !p_bkmk->i_byte_offset && !p_bkmk->i_time_offset &&
p_input->pp_bookmarks[i]->i_byte_offset ==
p_bkmk->i_byte_offset ) )
{
p_bkmk = p_input->pp_bookmarks[i];
break;
}
}
if( i < p_input->i_bookmarks )
{
TAB_REMOVE( p_input->i_bookmarks, p_input->pp_bookmarks,
p_bkmk );
vlc_seekpoint_Delete( p_bkmk );
/* Reflect the changes on the object var */
var_Change( p_input, "bookmark", VLC_VAR_CLEARCHOICES,
0, 0 );
for( i = 0; i < p_input->i_bookmarks; i++ )
{
val.i_int = i;
text.psz_string = p_input->pp_bookmarks[i]->psz_name;
var_Change( p_input, "bookmark", VLC_VAR_ADDCHOICE,
&val, &text );
}
val.i_int = i;
text.psz_string = p_input->pp_bookmarks[i]->psz_name;
var_Change( p_input, "bookmark", VLC_VAR_ADDCHOICE,
&val, &text );
}
i_ret = VLC_SUCCESS;
}
i_ret = VLC_SUCCESS;
else i_ret = VLC_EGENERIC;
break;
case INPUT_GET_BOOKMARKS:
......@@ -163,6 +145,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
p_bkmk );
vlc_seekpoint_Delete( p_bkmk );
}
var_Change( p_input, "bookmark", VLC_VAR_CLEARCHOICES, 0, 0 );
}
i_ret = VLC_SUCCESS;
break;
......
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