mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	media-session: handle dont-reconnect
If dont-reconnect is given and a target node, kill the stream when the target node can't be found.
This commit is contained in:
		
							parent
							
								
									8e969c9d44
								
							
						
					
					
						commit
						4be368c957
					
				
					 1 changed files with 15 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -1084,12 +1084,20 @@ static int rescan_node(struct impl *impl, struct node *node)
 | 
			
		|||
		pw_log_debug(NAME " %p: no session found for %d, try node", impl, node->obj.id);
 | 
			
		||||
 | 
			
		||||
		n_links = 1;
 | 
			
		||||
		peer = find_object(impl, find.path_id);
 | 
			
		||||
		if (peer != NULL && peer->obj.type == PW_TYPE_INTERFACE_Node) {
 | 
			
		||||
			if (peer->media_type == SPA_MEDIA_TYPE_audio)
 | 
			
		||||
				goto do_link_profile;
 | 
			
		||||
			else
 | 
			
		||||
				goto do_link;
 | 
			
		||||
		if ((peer = find_object(impl, find.path_id)) != NULL) {
 | 
			
		||||
			if (peer->obj.type == PW_TYPE_INTERFACE_Node) {
 | 
			
		||||
				if (peer->media_type == SPA_MEDIA_TYPE_audio)
 | 
			
		||||
					goto do_link_profile;
 | 
			
		||||
				else
 | 
			
		||||
					goto do_link;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else {
 | 
			
		||||
			str = spa_dict_lookup(props, "pipewire.dont-reconnect");
 | 
			
		||||
			if (str != NULL && pw_properties_parse_bool(str)) {
 | 
			
		||||
				pw_registry_proxy_destroy(impl->registry_proxy, node->obj.id);
 | 
			
		||||
				return -ENOENT;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1101,7 +1109,7 @@ static int rescan_node(struct impl *impl, struct node *node)
 | 
			
		|||
		client = find_object(impl, node->obj.parent_id);
 | 
			
		||||
		if (client && client->obj.type == PW_TYPE_INTERFACE_Client) {
 | 
			
		||||
			pw_client_proxy_error((struct pw_client_proxy*)client->obj.proxy,
 | 
			
		||||
				node->obj.id, ENOENT, "no session available");
 | 
			
		||||
				node->obj.id, -ENOENT, "no session available");
 | 
			
		||||
		}
 | 
			
		||||
		return -ENOENT;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue