From 0b8149fefbb8cbabfdd8fc7ca111fba72b4075e0 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 17 Jan 2006 12:30:03 +0000 Subject: [PATCH] Fixed a crash when wrapping the playlist viewer backwards, and made it always select the currently playing track when viewing the current playlist git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8358 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist_viewer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index c249142bda..9ce471877e 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -184,7 +184,7 @@ void playlist_buffer_load_entries_screen(struct playlist_buffer * pb, { int min_start=viewer.selected_track-2*screens[0].nb_lines; if(min_start<0) - min_start=0; + min_start=MAX_PLAYLIST_ENTRIES+min_start; playlist_buffer_load_entries(pb, min_start, FORWARD); } else @@ -334,10 +334,10 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer, if (!reload) { - if (global_settings.browse_current && !viewer->playlist) - viewer->selected_track = playlist_get_display_index() - 1; - else + if (viewer->playlist) viewer->selected_track = 0; + else + viewer->selected_track = playlist_get_display_index() - 1; } if (!update_playlist(true))