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 <cmatsuoka@gmail.com>
master
Claudio Matsuoka 13 years ago
parent 3bbb8494cc
commit 1f09a54501
  1. 8
      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));

Loading…
Cancel
Save