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,14 +1084,22 @@ 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);
 | 
							pw_log_debug(NAME " %p: no session found for %d, try node", impl, node->obj.id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		n_links = 1;
 | 
							n_links = 1;
 | 
				
			||||||
		peer = find_object(impl, find.path_id);
 | 
							if ((peer = find_object(impl, find.path_id)) != NULL) {
 | 
				
			||||||
		if (peer != NULL && peer->obj.type == PW_TYPE_INTERFACE_Node) {
 | 
								if (peer->obj.type == PW_TYPE_INTERFACE_Node) {
 | 
				
			||||||
				if (peer->media_type == SPA_MEDIA_TYPE_audio)
 | 
									if (peer->media_type == SPA_MEDIA_TYPE_audio)
 | 
				
			||||||
					goto do_link_profile;
 | 
										goto do_link_profile;
 | 
				
			||||||
				else
 | 
									else
 | 
				
			||||||
					goto do_link;
 | 
										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;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (find.sess == NULL) {
 | 
						if (find.sess == NULL) {
 | 
				
			||||||
		struct client *client;
 | 
							struct client *client;
 | 
				
			||||||
| 
						 | 
					@ -1101,7 +1109,7 @@ static int rescan_node(struct impl *impl, struct node *node)
 | 
				
			||||||
		client = find_object(impl, node->obj.parent_id);
 | 
							client = find_object(impl, node->obj.parent_id);
 | 
				
			||||||
		if (client && client->obj.type == PW_TYPE_INTERFACE_Client) {
 | 
							if (client && client->obj.type == PW_TYPE_INTERFACE_Client) {
 | 
				
			||||||
			pw_client_proxy_error((struct pw_client_proxy*)client->obj.proxy,
 | 
								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;
 | 
							return -ENOENT;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue