diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-01-17 14:15:47 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-01-17 14:15:47 +0000 |
commit | 2f56ee9d0ffecbae531dd198cfe51a334e05dbe4 (patch) | |
tree | ddbda8bf48c0a5f9c306a7f6e7f4cb7e6c7d64fc | |
parent | 0b8149fefbb8cbabfdd8fc7ca111fba72b4075e0 (diff) |
Proper fix for the playlist viewer crash
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8359 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/playlist_viewer.c | 6 |
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 |