mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Fixed right access use for pcm_plug
This commit is contained in:
parent
b0da2bacea
commit
fa6f875f57
3 changed files with 9 additions and 11 deletions
|
|
@ -106,6 +106,8 @@ int mask_single(const mask_t *mask);
|
|||
int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
|
||||
int snd_pcm_hw_param_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var);
|
||||
int snd_pcm_hw_param_test(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var, unsigned int val);
|
||||
int snd_pcm_hw_param_setinteger(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var);
|
||||
int snd_pcm_hw_param_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||
|
|
|
|||
|
|
@ -1051,7 +1051,7 @@ typedef struct _snd_pcm_hw_strategy_simple_choices {
|
|||
} snd_pcm_hw_strategy_simple_choices_t;
|
||||
|
||||
int snd_pcm_hw_param_test(const snd_pcm_hw_params_t *params,
|
||||
snd_pcm_hw_param_t var, unsigned int val)
|
||||
snd_pcm_hw_param_t var, unsigned int val)
|
||||
{
|
||||
if (hw_is_mask(var)) {
|
||||
const mask_t *mask = hw_param_mask_c(params, var);
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ static int snd_pcm_plug_hw_link(snd_pcm_hw_params_t *params,
|
|||
snd_pcm_t *slave,
|
||||
unsigned long private ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int rate_always, channels_always, format_always, access_always;
|
||||
int rate_never, channels_never, format_never, access_never;
|
||||
int rate_always, channels_always, format_always;
|
||||
int rate_never, channels_never, format_never;
|
||||
unsigned int links = (SND_PCM_HW_PARBIT_PERIOD_TIME |
|
||||
SND_PCM_HW_PARBIT_TICK_TIME);
|
||||
const mask_t *format_mask, *sformat_mask;
|
||||
|
|
@ -268,13 +268,6 @@ static int snd_pcm_plug_hw_link(snd_pcm_hw_params_t *params,
|
|||
snd_pcm_hw_param_never_eq(params,
|
||||
SND_PCM_HW_PARAM_RATE,
|
||||
sparams));
|
||||
access_always = snd_pcm_hw_param_always_eq(params,
|
||||
SND_PCM_HW_PARAM_ACCESS,
|
||||
sparams);
|
||||
access_never = (!access_always &&
|
||||
snd_pcm_hw_param_never_eq(params,
|
||||
SND_PCM_HW_PARAM_ACCESS,
|
||||
sparams));
|
||||
|
||||
if (rate_always)
|
||||
links |= (SND_PCM_HW_PARBIT_RATE |
|
||||
|
|
@ -610,7 +603,10 @@ static int snd_pcm_plug_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
clt_params.channels = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_CHANNELS, 0);
|
||||
clt_params.rate = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_RATE, 0);
|
||||
|
||||
slv_params.access = snd_pcm_hw_param_first(slave, &sparams, SND_PCM_HW_PARAM_ACCESS, 0);
|
||||
if (snd_pcm_hw_param_test(params, SND_PCM_HW_PARAM_ACCESS, clt_params.access))
|
||||
slv_params.access = clt_params.access;
|
||||
else
|
||||
slv_params.access = snd_pcm_hw_param_first(slave, &sparams, SND_PCM_HW_PARAM_ACCESS, 0);
|
||||
slv_params.format = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_FORMAT, 0);
|
||||
slv_params.channels = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_CHANNELS, 0);
|
||||
slv_params.rate = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_RATE, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue