snd_alsa_0_9.c now works on my cards. Hope it still works for Despair.

This commit is contained in:
Bill Currie 2001-02-23 06:36:19 +00:00
parent efad87a4b7
commit 265680d2c2
2 changed files with 8 additions and 8 deletions

View file

@ -93,13 +93,13 @@ qboolean SNDDMA_Init(void)
switch (rate) {
case -1:
if (snd_pcm_hw_params_set_rate(pcm, hw, 44100, 0) >= 0) {
if (snd_pcm_hw_params_set_rate_near(pcm, hw, 44100, 0) >= 0) {
frag_size = 256; /* assuming stereo 8 bit */
rate = 44100;
} else if (snd_pcm_hw_params_set_rate(pcm, hw, 22050, 0) >= 0) {
} else if (snd_pcm_hw_params_set_rate_near(pcm, hw, 22050, 0) >= 0) {
frag_size = 128; /* assuming stereo 8 bit */
rate = 22050;
} else if (snd_pcm_hw_params_set_rate(pcm, hw, 11025, 0) >= 0) {
} else if (snd_pcm_hw_params_set_rate_near(pcm, hw, 11025, 0) >= 0) {
frag_size = 64; /* assuming stereo 8 bit */
rate = 11025;
} else {
@ -110,7 +110,7 @@ qboolean SNDDMA_Init(void)
case 11025:
case 22050:
case 44100:
if (snd_pcm_hw_params_set_rate(pcm, hw, rate, 0) >= 0) {
if (snd_pcm_hw_params_set_rate_near(pcm, hw, rate, 0) >= 0) {
frag_size = 64 * rate / 11025; /* assuming stereo 8 bit */
break;
}

View file

@ -93,13 +93,13 @@ qboolean SNDDMA_Init(void)
switch (rate) {
case -1:
if (snd_pcm_hw_params_set_rate(pcm, hw, 44100, 0) >= 0) {
if (snd_pcm_hw_params_set_rate_near(pcm, hw, 44100, 0) >= 0) {
frag_size = 256; /* assuming stereo 8 bit */
rate = 44100;
} else if (snd_pcm_hw_params_set_rate(pcm, hw, 22050, 0) >= 0) {
} else if (snd_pcm_hw_params_set_rate_near(pcm, hw, 22050, 0) >= 0) {
frag_size = 128; /* assuming stereo 8 bit */
rate = 22050;
} else if (snd_pcm_hw_params_set_rate(pcm, hw, 11025, 0) >= 0) {
} else if (snd_pcm_hw_params_set_rate_near(pcm, hw, 11025, 0) >= 0) {
frag_size = 64; /* assuming stereo 8 bit */
rate = 11025;
} else {
@ -110,7 +110,7 @@ qboolean SNDDMA_Init(void)
case 11025:
case 22050:
case 44100:
if (snd_pcm_hw_params_set_rate(pcm, hw, rate, 0) >= 0) {
if (snd_pcm_hw_params_set_rate_near(pcm, hw, rate, 0) >= 0) {
frag_size = 64 * rate / 11025; /* assuming stereo 8 bit */
break;
}