aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-02-05 11:45:17 -0800
committerChris Robinson <[email protected]>2010-02-05 11:45:17 -0800
commit78c1629aebdda5281f9a4f9836d2a1812321c18c (patch)
tree8148cb2a9c43dd1388f35a67bfbe7aa82b7d4f68 /Alc/alsa.c
parentbd518ed26463bc83f975712275d7af0b69ec897d (diff)
Disable ALSA's resampler when no specific output rate is requested
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r--Alc/alsa.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index b56d0537..bf3afc83 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -67,6 +67,7 @@ MAKE_FUNC(snd_pcm_hw_params_set_channels);
MAKE_FUNC(snd_pcm_hw_params_set_periods_near);
MAKE_FUNC(snd_pcm_hw_params_set_rate_near);
MAKE_FUNC(snd_pcm_hw_params_set_rate);
+MAKE_FUNC(snd_pcm_hw_params_set_rate_resample);
MAKE_FUNC(snd_pcm_hw_params_set_buffer_size_near);
MAKE_FUNC(snd_pcm_hw_params_set_period_size_near);
MAKE_FUNC(snd_pcm_hw_params_set_buffer_size_min);
@@ -161,6 +162,7 @@ LOAD_FUNC(snd_pcm_hw_params_set_channels);
LOAD_FUNC(snd_pcm_hw_params_set_periods_near);
LOAD_FUNC(snd_pcm_hw_params_set_rate_near);
LOAD_FUNC(snd_pcm_hw_params_set_rate);
+LOAD_FUNC(snd_pcm_hw_params_set_rate_resample);
LOAD_FUNC(snd_pcm_hw_params_set_buffer_size_near);
LOAD_FUNC(snd_pcm_hw_params_set_buffer_size_min);
LOAD_FUNC(snd_pcm_hw_params_set_period_size_near);
@@ -615,6 +617,12 @@ static ALCboolean alsa_reset_playback(ALCdevice *device)
err = "set channels";
}
}
+ if(i >= 0 && !ConfigValueExists(NULL, "frequency") &&
+ (i=psnd_pcm_hw_params_set_rate_resample(data->pcmHandle, p, 0)) < 0)
+ {
+ AL_PRINT("Failed to disable ALSA resampler\n");
+ i = 0;
+ }
/* set rate (implicitly constrains period/buffer parameters) */
if(i >= 0 && (i=psnd_pcm_hw_params_set_rate_near(data->pcmHandle, p, &rate, NULL)) < 0)
err = "set rate near";