aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2007-09-17 03:40:24 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 10:50:34 -0400
commit0f28eca32b3064db29d4718156e692f4db75c7aa (patch)
treef5342c37d9062f1b3a66cff63b0820c3ce851146
parent8ffbc01e2cb2e203df910468f236c7b4e7b36f25 (diff)
[ALSA] cmipci: fix lookup of double rates
When using one of the double sampling rates, use half the sample rate to look up in the rates[] table, otherwise we stumble over the BUG(). Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/pci/cmipci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index b4f74ae9c0b6..7cf4fc193419 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -604,6 +604,9 @@ static unsigned int rates[] = { 5512, 11025, 22050, 44100, 8000, 16000, 32000, 4
604static unsigned int snd_cmipci_rate_freq(unsigned int rate) 604static unsigned int snd_cmipci_rate_freq(unsigned int rate)
605{ 605{
606 unsigned int i; 606 unsigned int i;
607
608 if (rate > 48000)
609 rate /= 2;
607 for (i = 0; i < ARRAY_SIZE(rates); i++) { 610 for (i = 0; i < ARRAY_SIZE(rates); i++) {
608 if (rates[i] == rate) 611 if (rates[i] == rate)
609 return i; 612 return i;