mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Accept string type card
Accept string type card entry to be compatible with others.
This commit is contained in:
		
							parent
							
								
									5741aec950
								
							
						
					
					
						commit
						145f85fff8
					
				
					 1 changed files with 13 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -686,12 +686,21 @@ static int parse_control_id(snd_config_t *conf, snd_ctl_elem_id_t *ctl_id, int *
 | 
			
		|||
		if (strcmp(id, "comment") == 0)
 | 
			
		||||
			continue;
 | 
			
		||||
		if (strcmp(id, "card") == 0) {
 | 
			
		||||
			const char *str;
 | 
			
		||||
			long v;
 | 
			
		||||
			if ((err = snd_config_get_integer(n, &v)) < 0) {
 | 
			
		||||
				SNDERR("field %s is not an integer", id);
 | 
			
		||||
				goto _err;
 | 
			
		||||
			}
 | 
			
		||||
			*cardp = v;
 | 
			
		||||
				if ((err = snd_config_get_string(n, &str)) < 0) {
 | 
			
		||||
					SNDERR("Invalid field %s", id);
 | 
			
		||||
					goto _err;
 | 
			
		||||
				}
 | 
			
		||||
				*cardp = snd_card_get_index(str);
 | 
			
		||||
				if (*cardp < 0) {
 | 
			
		||||
					SNDERR("Cannot get index for %s", str);
 | 
			
		||||
					err = *cardp;
 | 
			
		||||
					goto _err;
 | 
			
		||||
				}
 | 
			
		||||
			} else
 | 
			
		||||
				*cardp = v;
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
		if (strcmp(id, "iface") == 0 || strcmp(id, "interface") == 0) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue