]> git.sesse.net Git - vlc/commitdiff
playlist: repair playlist order on shuffle (fix #4857)
authorMax Dilipovich <repmovs@gmail.com>
Fri, 11 Apr 2014 19:05:19 +0000 (23:05 +0400)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 13 Apr 2014 18:10:10 +0000 (20:10 +0200)
Selecting first item to play in random mode as null, the old method
was giving a random item at a random position which resulted in only a
part of the queue playing. If we set first item to NULL, playlist
automaticaly selects first item from the reshuffled queue in the
request processing loop.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
src/playlist/item.c

index 69426da89c893eae7e5e2e9151ca7ace57d03913..088d8d77f2a8fdcbb30371129643c90b76150b72 100644 (file)
@@ -146,10 +146,7 @@ static void input_item_add_subitem_tree ( const vlc_event_t * p_event,
 
             if( var_GetBool( p_playlist, "random" ) )
             {
-                unsigned rand_pos =
-                    ((unsigned)vlc_mrand48()) % (last_pos - pos);
-                rand_pos += pos;
-                p_play_item = p_item->pp_children[rand_pos];
+                p_play_item = NULL;
             }
             else
             {