summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHardeep Sidhu <dyp@pobox.com>2006-05-05 08:32:07 +0000
committerHardeep Sidhu <dyp@pobox.com>2006-05-05 08:32:07 +0000
commited41ba0ca75c792e5a1ce9d88a4970882ac8c228 (patch)
tree122adf7745713c0237713f66d17a825bd7108326
parent000397dc69c40e9b2a44745e743a2b8bb1b47eb3 (diff)
downloadrockbox-ed41ba0ca75c792e5a1ce9d88a4970882ac8c228.tar.gz
rockbox-ed41ba0ca75c792e5a1ce9d88a4970882ac8c228.zip
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.c16
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)
1020 if (playlist == NULL) 1020 if (playlist == NULL)
1021 playlist = &current_playlist; 1021 playlist = &current_playlist;
1022 1022
1023 index = rotate_index(playlist, playlist->index); 1023 /* need to account for already skipped tracks */
1024 /* We should also skip already skipped entries before the entry to be skipepd. */ 1024 steps = calculate_step_count(playlist, steps);
1025 index += calculate_step_count(playlist, steps); 1025
1026 if (index < 0 || index >= playlist->amount) 1026 index = playlist->index + steps;
1027 return ; 1027 if (index < 0)
1028 1028 index += playlist->amount;
1029 index = (index+playlist->first_index) % playlist->amount; 1029 else if (index >= playlist->amount)
1030 index -= playlist->amount;
1031
1030 playlist->indices[index] |= PLAYLIST_SKIPPED; 1032 playlist->indices[index] |= PLAYLIST_SKIPPED;
1031} 1033}
1032 1034