mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse: don't leak device_name
Small cleanups
This commit is contained in:
		
							parent
							
								
									1f298cb5bf
								
							
						
					
					
						commit
						4e17d4cdf8
					
				
					 2 changed files with 13 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -1183,6 +1183,8 @@ static int set_mask(pa_context *c, struct global *g)
 | 
			
		|||
		g->event = PA_SUBSCRIPTION_EVENT_CLIENT;
 | 
			
		||||
		ginfo = &client_info;
 | 
			
		||||
	} else if (strcmp(g->type, PW_TYPE_INTERFACE_Link) == 0) {
 | 
			
		||||
		uint32_t src_node_id, dst_node_id;
 | 
			
		||||
 | 
			
		||||
                if ((str = pw_properties_get(g->props, PW_KEY_LINK_OUTPUT_PORT)) == NULL)
 | 
			
		||||
			return 0;
 | 
			
		||||
		g->link_info.src = pa_context_find_global(c, pw_properties_parse_int(str));
 | 
			
		||||
| 
						 | 
				
			
			@ -1193,17 +1195,18 @@ static int set_mask(pa_context *c, struct global *g)
 | 
			
		|||
		if (g->link_info.src == NULL || g->link_info.dst == NULL)
 | 
			
		||||
			return 0;
 | 
			
		||||
 | 
			
		||||
		pw_log_debug("link %d:%d->%d:%d",
 | 
			
		||||
				g->link_info.src->port_info.node_id,
 | 
			
		||||
				g->link_info.src->id,
 | 
			
		||||
				g->link_info.dst->port_info.node_id,
 | 
			
		||||
				g->link_info.dst->id);
 | 
			
		||||
		src_node_id = g->link_info.src->port_info.node_id;
 | 
			
		||||
		dst_node_id = g->link_info.dst->port_info.node_id;
 | 
			
		||||
 | 
			
		||||
		if ((f = pa_context_find_global(c, g->link_info.src->port_info.node_id)) != NULL &&
 | 
			
		||||
		    !f->init)
 | 
			
		||||
		pw_log_debug("link %d:%d->%d:%d",
 | 
			
		||||
				src_node_id, g->link_info.src->id,
 | 
			
		||||
				dst_node_id, g->link_info.dst->id);
 | 
			
		||||
 | 
			
		||||
		f = pa_context_find_global(c, src_node_id);
 | 
			
		||||
		if (f != NULL && !f->init)
 | 
			
		||||
			emit_event(c, f, PA_SUBSCRIPTION_EVENT_CHANGE);
 | 
			
		||||
		if ((f = pa_context_find_global(c, g->link_info.dst->port_info.node_id)) != NULL &&
 | 
			
		||||
		    !f->init)
 | 
			
		||||
		f = pa_context_find_global(c, dst_node_id);
 | 
			
		||||
		if (f != NULL && !f->init)
 | 
			
		||||
			emit_event(c, f, PA_SUBSCRIPTION_EVENT_CHANGE);
 | 
			
		||||
 | 
			
		||||
	} else if (strcmp(g->type, PW_TYPE_INTERFACE_Metadata) == 0) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -78,6 +78,7 @@ static void configure_device(pa_stream *s)
 | 
			
		|||
			s->device_index = g->id;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		free(s->device_name);
 | 
			
		||||
		if ((str = pw_properties_get(g->props, PW_KEY_NODE_NAME)) == NULL)
 | 
			
		||||
			s->device_name = strdup("unknown");
 | 
			
		||||
		else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue