Unverified Commit 9e57bb44 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8800 ALSA: usb-audio: Stop parsing channels bits when all channels are found.

parents aaad95d4 24617d0f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -305,9 +305,12 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits,
	c = 0;

	if (bits) {
		for (; bits && *maps; maps++, bits >>= 1)
		for (; bits && *maps; maps++, bits >>= 1) {
			if (bits & 1)
				chmap->map[c++] = *maps;
			if (c == chmap->channels)
				break;
		}
	} else {
		/* If we're missing wChannelConfig, then guess something
		    to make sure the channel map is not skipped entirely */