mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	policy-node: improve move
Don't try to do work when not needed
This commit is contained in:
		
							parent
							
								
									f9a5053c73
								
							
						
					
					
						commit
						28bb212630
					
				
					 1 changed files with 8 additions and 9 deletions
				
			
		| 
						 | 
					@ -784,17 +784,16 @@ static int metadata_property(void *object, uint32_t subject,
 | 
				
			||||||
			impl->default_video_source = value ? (uint32_t)atoi(value) : SPA_ID_INVALID;
 | 
								impl->default_video_source = value ? (uint32_t)atoi(value) : SPA_ID_INVALID;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		struct node *src_node, *dst_node = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		src_node = find_node_by_id(impl, subject);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (strcmp(key, "target.node") == 0 && value != NULL) {
 | 
							if (strcmp(key, "target.node") == 0 && value != NULL) {
 | 
				
			||||||
 | 
								struct node *src_node, *dst_node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			dst_node = find_node_by_id(impl, atoi(value));
 | 
								dst_node = find_node_by_id(impl, atoi(value));
 | 
				
			||||||
		}
 | 
								src_node = dst_node ? find_node_by_id(impl, subject) : NULL;
 | 
				
			||||||
		if (src_node && dst_node)
 | 
					
 | 
				
			||||||
 | 
								if (dst_node && src_node)
 | 
				
			||||||
				handle_move(impl, src_node, dst_node);
 | 
									handle_move(impl, src_node, dst_node);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue