mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
Added hack for rate to avoid overflow in other code
This commit is contained in:
parent
323a0f4419
commit
25978dbfa9
1 changed files with 8 additions and 1 deletions
|
|
@ -504,11 +504,18 @@ static int snd_pcm_plug_hw_refine_schange(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
||||||
snd_pcm_format_t format;
|
snd_pcm_format_t format;
|
||||||
snd_interval_t t, buffer_size;
|
snd_interval_t t, buffer_size;
|
||||||
const snd_interval_t *srate, *crate;
|
const snd_interval_t *srate, *crate;
|
||||||
|
unsigned int srate_min;
|
||||||
if (plug->srate == -2)
|
if (plug->srate == -2)
|
||||||
links |= SND_PCM_HW_PARBIT_RATE;
|
links |= SND_PCM_HW_PARBIT_RATE;
|
||||||
else
|
else {
|
||||||
snd_pcm_hw_param_refine_near(slave, sparams, SND_PCM_HW_PARAM_RATE,
|
snd_pcm_hw_param_refine_near(slave, sparams, SND_PCM_HW_PARAM_RATE,
|
||||||
params);
|
params);
|
||||||
|
/* HACK: to avoid overflow in PARTBIT_RATE code */
|
||||||
|
srate_min = snd_pcm_hw_param_get_min(sparams, SND_PCM_HW_PARAM_RATE, NULL);
|
||||||
|
if (srate_min < 4000)
|
||||||
|
_snd_pcm_hw_param_set_min(sparams, SND_PCM_HW_PARAM_RATE, srate_min, 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (plug->schannels == -2)
|
if (plug->schannels == -2)
|
||||||
links |= SND_PCM_HW_PARBIT_CHANNELS;
|
links |= SND_PCM_HW_PARBIT_CHANNELS;
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue