Commit 5c573b07 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

lib: simplify set_relative_playlist_position_and_play()

parent e15851d5
......@@ -733,25 +733,18 @@ static int set_relative_playlist_position_and_play(
{
bool b_loop = (p_mlp->e_playback_mode == libvlc_playback_mode_loop);
if(i_relative_position > 0)
while (i_relative_position > 0)
{
do
{
path = get_next_path(p_mlp, b_loop);
set_current_playing_item(p_mlp, path);
--i_relative_position;
}
while(i_relative_position > 0);
path = get_next_path(p_mlp, b_loop);
set_current_playing_item(p_mlp, path);
--i_relative_position;
}
else if(i_relative_position < 0)
while (i_relative_position < 0)
{
do
{
path = get_previous_path(p_mlp, b_loop);
set_current_playing_item(p_mlp, path);
++i_relative_position;
}
while (i_relative_position < 0);
path = get_previous_path(p_mlp, b_loop);
set_current_playing_item(p_mlp, path);
++i_relative_position;
}
}
else
......
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