mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	fix target node path handling
This commit is contained in:
		
							parent
							
								
									837c23a370
								
							
						
					
					
						commit
						4153fac9bb
					
				
					 3 changed files with 34 additions and 39 deletions
				
			
		| 
						 | 
				
			
			@ -185,6 +185,33 @@ no_node:
 | 
			
		|||
static void
 | 
			
		||||
on_port_added (PinosNode *node, PinosPort *port, PinosClient *client)
 | 
			
		||||
{
 | 
			
		||||
  PinosDaemon *this;
 | 
			
		||||
  PinosProperties *props;
 | 
			
		||||
  PinosPort *target;
 | 
			
		||||
  const gchar *path;
 | 
			
		||||
  GError *error = NULL;
 | 
			
		||||
  PinosLink *link;
 | 
			
		||||
 | 
			
		||||
  this = pinos_node_get_daemon (node);
 | 
			
		||||
 | 
			
		||||
  props = pinos_node_get_properties (node);
 | 
			
		||||
  path = pinos_properties_get (props, "pinos.target.node");
 | 
			
		||||
 | 
			
		||||
  if (path) {
 | 
			
		||||
    target = pinos_daemon_find_port (this,
 | 
			
		||||
                                     pinos_direction_reverse (port->direction),
 | 
			
		||||
                                     path,
 | 
			
		||||
                                     NULL,
 | 
			
		||||
                                     NULL,
 | 
			
		||||
                                     &error);
 | 
			
		||||
    if (target == NULL) {
 | 
			
		||||
      g_warning ("daemon %p: can't find port target: %s", this, error->message);
 | 
			
		||||
      g_clear_error (&error);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    link = pinos_link_new (pinos_node_get_daemon (node), port, target, NULL);
 | 
			
		||||
    pinos_client_add_object (client, G_OBJECT (link));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue