mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm_rate fix
This commit is contained in:
parent
3126678e72
commit
87f9071c08
3 changed files with 9 additions and 5 deletions
|
|
@ -342,6 +342,10 @@ int _snd_pcm_hw_param_min(snd_pcm_hw_params_t *params,
|
|||
unsigned int var, unsigned int val, int dir);
|
||||
int _snd_pcm_hw_param_max(snd_pcm_hw_params_t *params,
|
||||
unsigned int var, unsigned int val, int dir);
|
||||
int _snd_pcm_hw_param_minmax(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var,
|
||||
unsigned int min, int mindir,
|
||||
unsigned int max, int maxdir);
|
||||
int _snd_pcm_hw_param_refine(snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var,
|
||||
const snd_pcm_hw_params_t *src);
|
||||
|
|
|
|||
|
|
@ -430,9 +430,6 @@ static int snd_pcm_plug_hw_refine_schange(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
interval_t t;
|
||||
const interval_t *buffer_size;
|
||||
const interval_t *srate, *crate;
|
||||
err = _snd_pcm_hw_params_refine(sparams, links, params);
|
||||
if (err < 0)
|
||||
return err;
|
||||
snd_pcm_hw_param_refine_near(slave, sparams, SND_PCM_HW_PARAM_RATE,
|
||||
params);
|
||||
snd_pcm_hw_param_refine_near(slave, sparams, SND_PCM_HW_PARAM_CHANNELS,
|
||||
|
|
@ -475,6 +472,9 @@ static int snd_pcm_plug_hw_refine_schange(snd_pcm_t *pcm, snd_pcm_hw_params_t *p
|
|||
interval_muldiv(buffer_size, srate, crate, &t);
|
||||
interval_round(&t);
|
||||
err = _snd_pcm_hw_param_refine_interval(sparams, SND_PCM_HW_PARAM_BUFFER_SIZE, &t);
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = _snd_pcm_hw_params_refine(sparams, links, params);
|
||||
if (err < 0)
|
||||
return err;
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -279,8 +279,8 @@ static int snd_pcm_rate_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *
|
|||
_snd_pcm_hw_param_set(sparams, SND_PCM_HW_PARAM_SUBFORMAT,
|
||||
SND_PCM_SUBFORMAT_STD, 0);
|
||||
}
|
||||
_snd_pcm_hw_param_set(sparams, SND_PCM_HW_PARAM_RATE,
|
||||
rate->srate, 0);
|
||||
_snd_pcm_hw_param_minmax(sparams, SND_PCM_HW_PARAM_RATE,
|
||||
rate->srate, 0, rate->srate + 1, -1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue