Commit 92cf2514 authored by Jérome Decoodt's avatar Jérome Decoodt
Browse files

Fix a bug when shuffling playlist with 1 item

parent cc58badd
......@@ -147,8 +147,12 @@ int playlist_ItemArraySort( playlist_t *p_playlist, int i_items,
{
for( i_position = 0; i_position < i_items ; i_position ++ )
{
int i_new = rand() % (i_items - 1);
int i_new;
if( i_items > 1 )
i_new = rand() % (i_items - 1);
else
i_new = 0;
p_temp = pp_items[i_position];
pp_items[i_position] = pp_items[i_new];
pp_items[i_new] = p_temp;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment