]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mixer: sleep: Change to fade-in mood later.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 7 Jul 2018 10:44:47 +0000 (12:44 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 11 Aug 2018 13:50:21 +0000 (15:50 +0200)
When a sleep mood is given, we currently switch to the fade-in mood
too early, so that the fade-in mood rather than the sleep mood is
active during sleep time.

mixer.c

diff --git a/mixer.c b/mixer.c
index ad674bf537e89c5d89bb0ebf946bfd14dad1a81a..f0d5a02e37764cfa9a6bb7f033611516d66dc02d 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;
                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)
        for (;;) {
                time(&t1);
                if (wake_time_epoch <= t1 + fit)
@@ -324,6 +323,7 @@ static int com_sleep(const struct mixer *m, struct mixer_handle *h)
                        (delay % 3600) / 60);
                sleep(delay);
        }
                        (delay % 3600) / 60);
                sleep(delay);
        }
+       change_afs_mode(fi_mood);
        client_cmd("play");
        ret = fade(m, h, fiv, fit);
        PARA_INFO_LOG("fade complete, returning\n");
        client_cmd("play");
        ret = fade(m, h, fiv, fit);
        PARA_INFO_LOG("fade complete, returning\n");