diff options
author | Hardeep Sidhu <dyp@pobox.com> | 2006-04-20 07:30:28 +0000 |
---|---|---|
committer | Hardeep Sidhu <dyp@pobox.com> | 2006-04-20 07:30:28 +0000 |
commit | c7f304e1b9259a9f19f18daa71b6d199539b4a08 (patch) | |
tree | b1ddd17802051fcb0923d3eaf0a8ceb26a5f9fd9 /apps | |
parent | 24f0a374c64d09de4e92e2b46e893671ab9deced (diff) | |
download | rockbox-c7f304e1b9259a9f19f18daa71b6d199539b4a08.tar.gz rockbox-c7f304e1b9259a9f19f18daa71b6d199539b4a08.zip |
Stop playback and exit viewer if last track in current playlist is removed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9739 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playlist_viewer.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index ae27211ac2..2bbd2772f7 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -412,7 +412,7 @@ static bool update_playlist(bool force) { /* Reload tracks */ viewer.num_tracks = nb_tracks; - if (viewer.num_tracks < 0) + if (viewer.num_tracks <= 0) return false; playlist_buffer_load_entries_screen(&viewer.buffer, FORWARD); if (viewer.buffer.num_loaded <= 0) @@ -457,16 +457,21 @@ static int onplay_menu(int index) playlist_delete(viewer.playlist, current_track->index); if (current) { - /* Start playing new track except if it's the last track - in the playlist and repeat mode is disabled */ - current_track= - playlist_buffer_get_track(&viewer.buffer, index); - if (current_track->display_index != viewer.num_tracks || - global_settings.repeat_mode == REPEAT_ALL) + if (playlist_amount_ex(viewer.playlist) <= 0) + audio_stop(); + else { - talk_buffer_steal(); /* will use the mp3 buffer */ - audio_play(0); - viewer.current_playing_track = -1; + /* Start playing new track except if it's the lasttrack + track in the playlist and repeat mode is disabled */ + current_track = + playlist_buffer_get_track(&viewer.buffer, index); + if (current_track->display_index!=viewer.num_tracks || + global_settings.repeat_mode == REPEAT_ALL) + { + talk_buffer_steal(); /* will use the mp3 buffer */ + audio_play(0); + viewer.current_playing_track = -1; + } } } ret = 1; |