mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm: Remove assert() from snd_pcm_hw_params_slave()
Using assert() for non-fatal error checks is really brain-dead. These are especially bad, as it hits even in the normal operation with plugins and some h/w constraints. Reported-by: Alan Horstmann <gineera@aspect135.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									b4222f3fdc
								
							
						
					
					
						commit
						67f73b0fab
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -2244,9 +2244,11 @@ int snd_pcm_hw_params_slave(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
 | 
			
		|||
	snd_pcm_hw_params_t slave_params;
 | 
			
		||||
	int err;
 | 
			
		||||
	err = sprepare(pcm, &slave_params);
 | 
			
		||||
	assert(err >= 0);
 | 
			
		||||
	if (err < 0)
 | 
			
		||||
		return err;
 | 
			
		||||
	err = schange(pcm, params, &slave_params);
 | 
			
		||||
	assert(err >= 0);
 | 
			
		||||
	if (err < 0)
 | 
			
		||||
		return err;
 | 
			
		||||
	err = sparams(pcm, &slave_params);
 | 
			
		||||
	if (err < 0)
 | 
			
		||||
		cchange(pcm, params, &slave_params);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue