summaryrefslogtreecommitdiff
path: root/apps/playlist_viewer.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playlist_viewer.c')
-rw-r--r--apps/playlist_viewer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 9ce471877e..6dc168d49a 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -37,6 +37,7 @@
#include "talk.h"
#include "misc.h"
#include "action.h"
+#include "debug.h"
#include "lang.h"
@@ -183,8 +184,9 @@ void playlist_buffer_load_entries_screen(struct playlist_buffer * pb,
if(direction==FORWARD)
{
int min_start=viewer.selected_track-2*screens[0].nb_lines;
- if(min_start<0)
- min_start=MAX_PLAYLIST_ENTRIES+min_start;
+ while(min_start<0)
+ min_start+=viewer.num_tracks;
+ min_start %= viewer.num_tracks;
playlist_buffer_load_entries(pb, min_start, FORWARD);
}
else