Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df1e4719 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Takashi Iwai
Browse files

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: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0f519b62
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1120,11 +1120,13 @@ static int snd_interval_step(struct snd_interval *i, unsigned int step)
	n = i->min % step;
	n = i->min % step;
	if (n != 0 || i->openmin) {
	if (n != 0 || i->openmin) {
		i->min += step - n;
		i->min += step - n;
		i->openmin = 0;
		changed = 1;
		changed = 1;
	}
	}
	n = i->max % step;
	n = i->max % step;
	if (n != 0 || i->openmax) {
	if (n != 0 || i->openmax) {
		i->max -= n;
		i->max -= n;
		i->openmax = 0;
		changed = 1;
		changed = 1;
	}
	}
	if (snd_interval_checkempty(i)) {
	if (snd_interval_checkempty(i)) {