]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: pcm: snd_interval_step: fix changes of open intervals
authorClemens Ladisch <clemens@ladisch.de>
Sun, 7 Sep 2014 19:43:41 +0000 (21:43 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 8 Sep 2014 08:54:25 +0000 (10:54 +0200)
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>
sound/core/pcm_lib.c

index 6fd5e1ce54622d2970d6da9383b703f3da33ec93..b03c7ae5f4e3bcd2adb6aed39489cb97e0254c11 100644 (file)
@@ -1120,11 +1120,13 @@ static int snd_interval_step(struct snd_interval *i, unsigned int step)
        n = i->min % step;
        if (n != 0 || i->openmin) {
                i->min += step - n;
+               i->openmin = 0;
                changed = 1;
        }
        n = i->max % step;
        if (n != 0 || i->openmax) {
                i->max -= n;
+               i->openmax = 0;
                changed = 1;
        }
        if (snd_interval_checkempty(i)) {