Added missing rawmidi functions. Cleaned PCM use of masks

This commit is contained in:
Abramo Bagnara 2001-02-04 18:57:05 +00:00
parent a7561a9c7e
commit 4c9fd35a60
14 changed files with 159 additions and 135 deletions

View file

@ -133,16 +133,14 @@ void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_ufr
static int snd_pcm_linear_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params)
{
int err;
snd_pcm_access_mask_t *access_mask = alloca(snd_pcm_access_mask_sizeof());
snd_pcm_format_mask_t *format_mask = alloca(snd_pcm_format_mask_sizeof());
snd_mask_load(access_mask, SND_PCM_ACCBIT_PLUGIN);
snd_mask_load(format_mask, SND_PCM_FMTBIT_LINEAR);
snd_pcm_access_mask_t access_mask = { SND_PCM_ACCBIT_PLUGIN };
snd_pcm_format_mask_t format_mask = { SND_PCM_FMTBIT_LINEAR };
err = _snd_pcm_hw_param_set_mask(params, SND_PCM_HW_PARAM_ACCESS,
access_mask);
&access_mask);
if (err < 0)
return err;
err = _snd_pcm_hw_param_set_mask(params, SND_PCM_HW_PARAM_FORMAT,
format_mask);
&format_mask);
if (err < 0)
return err;
err = _snd_pcm_hw_params_set_subformat(params, SND_PCM_SUBFORMAT_STD);
@ -155,11 +153,10 @@ static int snd_pcm_linear_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, sn
static int snd_pcm_linear_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *sparams)
{
snd_pcm_linear_t *linear = pcm->private;
snd_pcm_access_mask_t *saccess_mask = alloca(snd_pcm_access_mask_sizeof());
snd_mask_load(saccess_mask, SND_PCM_ACCBIT_MMAP);
snd_pcm_access_mask_t saccess_mask = { SND_PCM_ACCBIT_MMAP };
_snd_pcm_hw_params_any(sparams);
_snd_pcm_hw_param_set_mask(sparams, SND_PCM_HW_PARAM_ACCESS,
saccess_mask);
&saccess_mask);
_snd_pcm_hw_params_set_format(sparams, linear->sformat);
_snd_pcm_hw_params_set_subformat(sparams, SND_PCM_SUBFORMAT_STD);
return 0;