]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mixer.c
Avoid warning about sys/sysctl.h on glibc-2.30.
[paraslash.git] / mixer.c
diff --git a/mixer.c b/mixer.c
index d84f6d4e3358ecf2e309fcaaaea692e2e590abc8..efa42b93efb9ce0cf6f277b0f117806845455a26 100644 (file)
--- a/mixer.c
+++ b/mixer.c
@@ -313,7 +313,6 @@ static int com_sleep(const struct mixer *m, struct mixer_handle *h)
                client_cmd("stop");
        if (!fit || !fi_mood) /* nothing to do */
                return 1;
-       change_afs_mode(fi_mood);
        for (;;) {
                time(&t1);
                if (wake_time_epoch <= t1 + fit)
@@ -324,7 +323,11 @@ static int com_sleep(const struct mixer *m, struct mixer_handle *h)
                        (delay % 3600) / 60);
                sleep(delay);
        }
-       client_cmd("play");
+       change_afs_mode(fi_mood);
+       if (sleep_mood) /* currently playing */
+               client_cmd("next");
+       else /* currently stopped */
+               client_cmd("play");
        ret = fade(m, h, fiv, fit);
        PARA_INFO_LOG("fade complete, returning\n");
        return ret;