diff options
author | Hardeep Sidhu <dyp@pobox.com> | 2006-05-05 08:32:07 +0000 |
---|---|---|
committer | Hardeep Sidhu <dyp@pobox.com> | 2006-05-05 08:32:07 +0000 |
commit | ed41ba0ca75c792e5a1ce9d88a4970882ac8c228 (patch) | |
tree | 122adf7745713c0237713f66d17a825bd7108326 | |
parent | 000397dc69c40e9b2a44745e743a2b8bb1b47eb3 (diff) |
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
-rw-r--r-- | apps/playlist.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 8c208687c8..7942bac1ca 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -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; } |