From 176d4e57f7381f6215f2baf3b07f859bb4c72e76 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 11 Aug 2018 16:01:51 +0200 Subject: [PATCH] mixer: sleep: Change to next file at fade-in time. If a sleep mood is given, we currently start fading in with the current file of the sleep mood still playing. It might therefore take a long time until the first file of the fade-in mood is started. This patch avoids this problem by running "para client next" at fade-in time right after the mood has been changed to the fade-in mood. --- mixer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mixer.c b/mixer.c index f0d5a02e..4ceaba9c 100644 --- a/mixer.c +++ b/mixer.c @@ -324,7 +324,10 @@ static int com_sleep(const struct mixer *m, struct mixer_handle *h) sleep(delay); } change_afs_mode(fi_mood); - client_cmd("play"); + 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; -- 2.39.5