From 1f09a545017ac77ebe3a2a63a4e5b732c0d6e9eb Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Fri, 12 Apr 2013 21:06:46 -0300 Subject: [PATCH] Re-shuffle when looping over module list If loop over the entire list is enabled and random playing mode is used, use a different order in each loop. Signed-off-by: Claudio Matsuoka --- src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index a7d09d1..df205dd 100644 --- a/src/main.c +++ b/src/main.c @@ -275,10 +275,6 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); } - if (opt.random) { - shuffle(argc - optind + 1, &argv[optind - 1]); - } - #ifdef HAVE_SIGNAL_H signal(SIGTERM, cleanup); signal(SIGINT, cleanup); @@ -310,6 +306,10 @@ int main(int argc, char **argv) first = optind; play_all: + if (opt.random) { + shuffle(argc - optind + 1, &argv[optind - 1]); + } + for (played = 0; optind < argc; optind++) { memcpy(&opt, &save_opt, sizeof (struct options));