Minor fix for insert_shuffle when playlist is empty

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9716 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Hardeep Sidhu 2006-04-18 16:44:51 +00:00
parent d0de1aafac
commit 095ad1a39c

View file

@ -601,6 +601,8 @@ static int add_track_to_playlist(struct playlist_info* playlist,
flags = PLAYLIST_INSERT_TYPE_APPEND; flags = PLAYLIST_INSERT_TYPE_APPEND;
break; break;
case PLAYLIST_INSERT_SHUFFLED: case PLAYLIST_INSERT_SHUFFLED:
{
if (playlist->amount > 0)
{ {
int offset; int offset;
int n = playlist->amount - int n = playlist->amount -
@ -616,6 +618,9 @@ static int add_track_to_playlist(struct playlist_info* playlist,
position -= playlist->amount; position -= playlist->amount;
insert_position = position; insert_position = position;
}
else
position = insert_position = 0;
break; break;
} }
} }