From 4044499198172228dec566782dbe1707f90898a4 Mon Sep 17 00:00:00 2001 From: Dave Hooper Date: Thu, 2 Jul 2009 22:45:00 +0000 Subject: [PATCH] Fix playlist viewer behaviour when deleting tracks (one ret had missed being changed to ret_val). FIx playlist viewer behaviour when deleting the only remaining track in playlist (i.e. when audio stops, prevent resume playback also) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21615 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist_viewer.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 961d2cdf12..5fcf9f237c 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -418,10 +418,18 @@ static bool update_playlist(bool force) /* Reload tracks */ viewer.num_tracks = nb_tracks; if (viewer.num_tracks <= 0) + { + global_status.resume_index = -1; + global_status.resume_offset = -1; return false; + } playlist_buffer_load_entries_screen(&viewer.buffer, FORWARD); if (viewer.buffer.num_loaded <= 0) + { + global_status.resume_index = -1; + global_status.resume_offset = -1; return false; + } } return true; } @@ -716,7 +724,7 @@ bool playlist_viewer_ex(const char* filename) ret = true; goto exit; } - else if (ret > 0) + else if (ret_val > 0) { /* Playlist changed */ gui_synclist_del_item(&playlist_lists);