mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	graph: don't let required number of ports become negative
Add a check against letting the required number of ports become negative for a node. With certain timing between the main and data thread, this can otherwise happen. For nodes where links are unlinked and relinked, a negative number may mean that the scheduler skips the node and doesn't call process_output().
This commit is contained in:
		
							parent
							
								
									c1aa3b4625
								
							
						
					
					
						commit
						6503351a0d
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -160,8 +160,10 @@ static inline void spa_graph_port_remove(struct spa_graph_port *port)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	spa_debug("port %p remove", port);
 | 
						spa_debug("port %p remove", port);
 | 
				
			||||||
	spa_list_remove(&port->link);
 | 
						spa_list_remove(&port->link);
 | 
				
			||||||
	if (!(port->flags & SPA_PORT_INFO_FLAG_OPTIONAL))
 | 
						if (!(port->flags & SPA_PORT_INFO_FLAG_OPTIONAL) &&
 | 
				
			||||||
 | 
						    port->node->required[port->direction] > 0) {
 | 
				
			||||||
		port->node->required[port->direction]--;
 | 
							port->node->required[port->direction]--;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void
 | 
					static inline void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue