diff options
-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; } |