mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	alsa-ucm: remove extra space from the device.intended_roles property
Before:
  device.intended_roles = " voice"
After:
  device.intended_roles = "voice"
Link: eb870fcba9
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
			
			
This commit is contained in:
		
							parent
							
								
									425c849042
								
							
						
					
					
						commit
						2c3e8d90d3
					
				
					 1 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
					@ -662,7 +662,7 @@ static void add_media_role(const char *name, pa_alsa_ucm_device *list, const cha
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static char *modifier_name_to_role(const char *mod_name, bool *is_sink) {
 | 
					static char *modifier_name_to_role(const char *mod_name, bool *is_sink) {
 | 
				
			||||||
    char *sub = NULL, *tmp;
 | 
					    char *sub = NULL, *tmp, *pos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *is_sink = false;
 | 
					    *is_sink = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -672,19 +672,24 @@ static char *modifier_name_to_role(const char *mod_name, bool *is_sink) {
 | 
				
			||||||
    } else if (pa_startswith(mod_name, "Capture"))
 | 
					    } else if (pa_startswith(mod_name, "Capture"))
 | 
				
			||||||
        sub = pa_xstrdup(mod_name + 7);
 | 
					        sub = pa_xstrdup(mod_name + 7);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!sub || !*sub) {
 | 
					    pos = sub;
 | 
				
			||||||
 | 
					    while (pos && *pos == ' ') pos++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!pos || !*pos) {
 | 
				
			||||||
        pa_xfree(sub);
 | 
					        pa_xfree(sub);
 | 
				
			||||||
        pa_log_warn("Can't match media roles for modifier %s", mod_name);
 | 
					        pa_log_warn("Can't match media roles for modifier %s", mod_name);
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tmp = sub;
 | 
					    tmp = pos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    do {
 | 
					    do {
 | 
				
			||||||
        *tmp = tolower(*tmp);
 | 
					        *tmp = tolower(*tmp);
 | 
				
			||||||
    } while (*(++tmp));
 | 
					    } while (*(++tmp));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return sub;
 | 
					    tmp = pa_xstrdup(pos);
 | 
				
			||||||
 | 
					    pa_xfree(sub);
 | 
				
			||||||
 | 
					    return tmp;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void ucm_set_media_roles(pa_alsa_ucm_modifier *modifier, pa_alsa_ucm_device *list, const char *mod_name) {
 | 
					static void ucm_set_media_roles(pa_alsa_ucm_modifier *modifier, pa_alsa_ucm_device *list, const char *mod_name) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue