mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	media-session: sanitize description
Because we use the description as the JACK name, remove the : so that it looks somewhat ok in more cases.
This commit is contained in:
		
							parent
							
								
									60233e30a7
								
							
						
					
					
						commit
						aea79cd79c
					
				
					 5 changed files with 52 additions and 40 deletions
				
			
		| 
						 | 
				
			
			@ -1823,6 +1823,26 @@ char *sm_media_session_sanitize_name(char *name, int size, char sub, const char
 | 
			
		|||
	return name;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *sm_media_session_sanitize_description(char *name, int size, char sub, const char *fmt, ...)
 | 
			
		||||
{
 | 
			
		||||
	char *p;
 | 
			
		||||
	va_list varargs;
 | 
			
		||||
 | 
			
		||||
	va_start(varargs, fmt);
 | 
			
		||||
	if (vsnprintf(name, size, fmt, varargs) < 0)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	va_end(varargs);
 | 
			
		||||
 | 
			
		||||
	for (p = name; *p; p++) {
 | 
			
		||||
		switch(*p) {
 | 
			
		||||
		case ':':
 | 
			
		||||
			*p = sub;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return name;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void monitor_core_done(void *data, uint32_t id, int seq)
 | 
			
		||||
{
 | 
			
		||||
	struct impl *impl = data;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue