From: Andre Noll <maan@systemlinux.org>
Date: Sun, 15 Jul 2012 21:57:53 +0000 (+0200)
Subject: fade: Handle non-positive fade time gracefully.
X-Git-Tag: v0.4.12~10^2~1
X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=49412fa9ecfa07dfcb6e7a087d70de9fc88838a7;p=paraslash.git

fade: Handle non-positive fade time gracefully.

Currently, we don't do anything if the fade_time parameter is less
than or equal to zero. Just setting the destination volume seems to
be more natural in this case.
---

diff --git a/fade.c b/fade.c
index 2954fa32..68e1b5f5 100644
--- a/fade.c
+++ b/fade.c
@@ -52,7 +52,7 @@ static int fade(struct mixer *m, struct mixer_handle *h, int new_vol, int fade_t
 	unsigned long long tmp, tmp2; /* Careful with that axe, Eugene! */
 
 	if (fade_time <= 0)
-		return 1;
+		return m->set(h, new_vol);
 	secs = fade_time;
 	PARA_NOTICE_LOG("fading to %d in %d seconds\n", new_vol, secs);
 	ret = m->get(h);