aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2014-09-07 15:43:41 -0400
committerTakashi Iwai <tiwai@suse.de>2014-09-08 04:54:25 -0400
commitdf1e471966479526ae64b64d8851a89db26b30bb (patch)
tree6608122692b7a7fd212a2406440356cf5ca5c4c1
parent0f519b622151339b7754d0406ddc40940063572a (diff)
ALSA: pcm: snd_interval_step: fix changes of open intervals
Changing an interval boundary to a multiple of the step size makes that boundary exact. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/core/pcm_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 6fd5e1ce5462..b03c7ae5f4e3 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1120,11 +1120,13 @@ static int snd_interval_step(struct snd_interval *i, unsigned int step)
1120 n = i->min % step; 1120 n = i->min % step;
1121 if (n != 0 || i->openmin) { 1121 if (n != 0 || i->openmin) {
1122 i->min += step - n; 1122 i->min += step - n;
1123 i->openmin = 0;
1123 changed = 1; 1124 changed = 1;
1124 } 1125 }
1125 n = i->max % step; 1126 n = i->max % step;
1126 if (n != 0 || i->openmax) { 1127 if (n != 0 || i->openmax) {
1127 i->max -= n; 1128 i->max -= n;
1129 i->openmax = 0;
1128 changed = 1; 1130 changed = 1;
1129 } 1131 }
1130 if (snd_interval_checkempty(i)) { 1132 if (snd_interval_checkempty(i)) {