mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	ucm: fixed find-device substitution (non-continuous PCM devices)
The PCM device numbers may be non-continous. Skip them when -ENOENT error is returned. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									652ddf866f
								
							
						
					
					
						commit
						508506a80c
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -380,12 +380,15 @@ static struct lookup_iterate *rval_pcm_lookup1(struct lookup_iterate *iter,
 | 
			
		|||
	snd_ctl_t *ctl = iter->ctl_list->ctl;
 | 
			
		||||
	int err;
 | 
			
		||||
 | 
			
		||||
next:
 | 
			
		||||
	if (snd_ctl_pcm_next_device(ctl, &device) < 0 || device < 0)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	pcminfo = iter->info;
 | 
			
		||||
	snd_pcm_info_set_device(pcminfo, device);
 | 
			
		||||
	err = snd_ctl_pcm_info(ctl, pcminfo);
 | 
			
		||||
	if (err < 0) {
 | 
			
		||||
		if (err == -ENOENT)
 | 
			
		||||
			goto next;
 | 
			
		||||
		uc_error("Unable to obtain PCM info (device %d)", device);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue