mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
[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>
This commit is contained in:
parent
8ffbc01e2c
commit
0f28eca32b
1 changed files with 3 additions and 0 deletions
|
@ -604,6 +604,9 @@ static unsigned int rates[] = { 5512, 11025, 22050, 44100, 8000, 16000, 32000, 4
|
|||
static unsigned int snd_cmipci_rate_freq(unsigned int rate)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (rate > 48000)
|
||||
rate /= 2;
|
||||
for (i = 0; i < ARRAY_SIZE(rates); i++) {
|
||||
if (rates[i] == rate)
|
||||
return i;
|
||||
|
|
Loading…
Reference in a new issue