diff options
author | Chris Robinson <[email protected]> | 2010-02-05 11:45:17 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-02-05 11:45:17 -0800 |
commit | 78c1629aebdda5281f9a4f9836d2a1812321c18c (patch) | |
tree | 8148cb2a9c43dd1388f35a67bfbe7aa82b7d4f68 /Alc/alsa.c | |
parent | bd518ed26463bc83f975712275d7af0b69ec897d (diff) |
Disable ALSA's resampler when no specific output rate is requested
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r-- | Alc/alsa.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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"; |