mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Added missing rawmidi functions. Cleaned PCM use of masks
This commit is contained in:
		
							parent
							
								
									a7561a9c7e
								
							
						
					
					
						commit
						4c9fd35a60
					
				
					 14 changed files with 159 additions and 135 deletions
				
			
		| 
						 | 
				
			
			@ -226,16 +226,14 @@ snd_pcm_uframes_t snd_pcm_rate_shrink(const snd_pcm_channel_area_t *dst_areas,
 | 
			
		|||
static int snd_pcm_rate_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);
 | 
			
		||||
| 
						 | 
				
			
			@ -256,11 +254,10 @@ static int snd_pcm_rate_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_
 | 
			
		|||
static int snd_pcm_rate_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *sparams)
 | 
			
		||||
{
 | 
			
		||||
	snd_pcm_rate_t *rate = 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);
 | 
			
		||||
	if (rate->sformat != SND_PCM_FORMAT_NONE) {
 | 
			
		||||
		_snd_pcm_hw_params_set_format(sparams, rate->sformat);
 | 
			
		||||
		_snd_pcm_hw_params_set_subformat(sparams, SND_PCM_SUBFORMAT_STD);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue