mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-10-29 05:40:25 -04:00 
			
		
		
		
	ucm: fix the reload call (snd_use_case_mgr_reload)
Handle the local configuration and macros trees properly. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									4119e33d28
								
							
						
					
					
						commit
						0418fd32c7
					
				
					 3 changed files with 16 additions and 12 deletions
				
			
		|  | @ -1527,14 +1527,6 @@ int snd_use_case_mgr_open(snd_use_case_mgr_t **uc_mgr, | |||
| 		return err; | ||||
| 	} | ||||
| 
 | ||||
| 	err = snd_config_top(&mgr->local_config); | ||||
| 	if (err < 0) | ||||
| 		goto _err; | ||||
| 
 | ||||
| 	err = snd_config_top(&mgr->macros); | ||||
| 	if (err < 0) | ||||
| 		goto _err; | ||||
| 
 | ||||
| 	mgr->card_name = strdup(card_name); | ||||
| 	if (mgr->card_name == NULL) { | ||||
| 		err = -ENOMEM; | ||||
|  |  | |||
|  | @ -2807,6 +2807,14 @@ int uc_mgr_import_master_config(snd_use_case_mgr_t *uc_mgr) | |||
| 	const char *name; | ||||
| 	int err; | ||||
| 
 | ||||
| 	err = snd_config_top(&uc_mgr->local_config); | ||||
| 	if (err < 0) | ||||
| 		return err; | ||||
| 
 | ||||
| 	err = snd_config_top(&uc_mgr->macros); | ||||
| 	if (err < 0) | ||||
| 		return err; | ||||
| 
 | ||||
| 	name = uc_mgr->card_name; | ||||
| 	if (strncmp(name, "hw:", 3) == 0) { | ||||
| 		err = get_by_card(uc_mgr, name); | ||||
|  |  | |||
|  | @ -734,6 +734,14 @@ void uc_mgr_free_verb(snd_use_case_mgr_t *uc_mgr) | |||
| 	struct list_head *pos, *npos; | ||||
| 	struct use_case_verb *verb; | ||||
| 
 | ||||
| 	if (uc_mgr->local_config) { | ||||
| 		snd_config_delete(uc_mgr->local_config); | ||||
| 		uc_mgr->local_config = NULL; | ||||
| 	} | ||||
| 	if (uc_mgr->macros) { | ||||
| 		snd_config_delete(uc_mgr->macros); | ||||
| 		uc_mgr->macros = NULL; | ||||
| 	} | ||||
| 	list_for_each_safe(pos, npos, &uc_mgr->verb_list) { | ||||
| 		verb = list_entry(pos, struct use_case_verb, list); | ||||
| 		free(verb->name); | ||||
|  | @ -768,10 +776,6 @@ void uc_mgr_free_verb(snd_use_case_mgr_t *uc_mgr) | |||
| 
 | ||||
| void uc_mgr_free(snd_use_case_mgr_t *uc_mgr) | ||||
| { | ||||
| 	if (uc_mgr->local_config) | ||||
| 		snd_config_delete(uc_mgr->local_config); | ||||
| 	if (uc_mgr->macros) | ||||
| 		snd_config_delete(uc_mgr->macros); | ||||
| 	uc_mgr_free_verb(uc_mgr); | ||||
| 	uc_mgr_free_ctl_list(uc_mgr); | ||||
| 	free(uc_mgr->card_name); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jaroslav Kysela
						Jaroslav Kysela