Fixed bug with playlist_skip_entry when track to be skipped was less then current index
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9879 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
000397dc69
commit
ed41ba0ca7
1 changed files with 9 additions and 7 deletions
|
@ -1020,13 +1020,15 @@ void playlist_skip_entry(struct playlist_info *playlist, int steps)
|
|||
if (playlist == NULL)
|
||||
playlist = ¤t_playlist;
|
||||
|
||||
index = rotate_index(playlist, playlist->index);
|
||||
/* We should also skip already skipped entries before the entry to be skipepd. */
|
||||
index += calculate_step_count(playlist, steps);
|
||||
if (index < 0 || index >= playlist->amount)
|
||||
return ;
|
||||
|
||||
index = (index+playlist->first_index) % playlist->amount;
|
||||
/* need to account for already skipped tracks */
|
||||
steps = calculate_step_count(playlist, steps);
|
||||
|
||||
index = playlist->index + steps;
|
||||
if (index < 0)
|
||||
index += playlist->amount;
|
||||
else if (index >= playlist->amount)
|
||||
index -= playlist->amount;
|
||||
|
||||
playlist->indices[index] |= PLAYLIST_SKIPPED;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue