aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-04-05 19:35:03 -0700
committerChris Robinson <[email protected]>2016-04-05 19:35:03 -0700
commit071f8a7b188a4e05b66a525e6f9d47f51b09223d (patch)
treef760c07a18e699070d6aa0755f701508f0b4dbdf /Alc
parent8145a26d07fd1a99c8cf72b1d02650e0988232b5 (diff)
Also disable ALSA's resampler when not requesting a sample rate
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/alsa.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c
index 3a0ed205..805d66e3 100644
--- a/Alc/backends/alsa.c
+++ b/Alc/backends/alsa.c
@@ -773,11 +773,14 @@ static ALCboolean ALCplaybackAlsa_reset(ALCplaybackAlsa *self)
}
CHECK(snd_pcm_hw_params_set_channels(self->pcmHandle, hp, ChannelsFromDevFmt(device->FmtChans)));
/* set rate (implicitly constrains period/buffer parameters) */
- if(!GetConfigValueBool(al_string_get_cstr(device->DeviceName), "alsa", "allow-resampler", 0))
+ if(!GetConfigValueBool(al_string_get_cstr(device->DeviceName), "alsa", "allow-resampler", 0) ||
+ !(device->Flags&DEVICE_FREQUENCY_REQUEST))
{
if(snd_pcm_hw_params_set_rate_resample(self->pcmHandle, hp, 0) < 0)
ERR("Failed to disable ALSA resampler\n");
}
+ else if(snd_pcm_hw_params_set_rate_resample(self->pcmHandle, hp, 1) < 0)
+ ERR("Failed to enable ALSA resampler\n");
CHECK(snd_pcm_hw_params_set_rate_near(self->pcmHandle, hp, &rate, NULL));
/* set buffer time (implicitly constrains period/buffer parameters) */
if((err=snd_pcm_hw_params_set_buffer_time_near(self->pcmHandle, hp, &bufferLen, NULL)) < 0)